This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set up database | |
| setup_db: | |
| ./bin/init_db.sh | |
| # Start dev server | |
| start: | |
| air | |
| .PHONY: setup_db start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root = "." | |
| tmp_dir = "tmp" | |
| [build] | |
| bin = "./tmp/main" | |
| cmd = "go build -o ./tmp/main ./cmd/app/main.go" | |
| delay = 1000 | |
| exclude_dir = ["assets", "tmp", "vendor", "docker", "bin"] | |
| exclude_file = [] | |
| exclude_regex = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "golang-clean-architecture-ent-gqlgen/config" | |
| "net/http" | |
| "github.com/labstack/echo/v4" | |
| "github.com/labstack/echo/v4/middleware" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| database: | |
| user: root | |
| password: root | |
| net: tcp | |
| addr: 127.0.0.1:3306 | |
| dbname: golang_clean_architecture_ent_gqlgen | |
| allowNativePasswords: true | |
| params: | |
| parseTime: true | |
| charset: utf8mb4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package config | |
| import ( | |
| "fmt" | |
| "golang-clean-architecture-ent-gqlgen/pkg/util/environment" | |
| "log" | |
| "os" | |
| "path" | |
| "path/filepath" | |
| "runtime" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set up database | |
| setup_db: | |
| ./bin/init_db.sh | |
| .PHONY: setup_db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cd docker || exit | |
| docker compose cp ./mysql_data/sql mysql:/var/lib/mysql/ | |
| docker compose exec mysql bash -c "mysql -uroot -proot < /var/lib/mysql/sql/reset_database.sql" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DROP DATABASE IF EXISTS golang_clean_architecture_ent_gqlgen; | |
| CREATE DATABASE golang_clean_architecture_ent_gqlgen CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3' | |
| services: | |
| mysql: | |
| platform: linux/x86_64 | |
| image: mysql:8.0 | |
| volumes: | |
| - mysql-data:/var/lib/mysql | |
| command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_0900_as_ci --default-authentication-plugin=mysql_native_password | |
| environment: | |
| TZ: "/usr/share/zoneinfo/Asia/Tokyo" # wherever you want |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DROP DATABASE IF EXISTS golang_clean_architecture_ent_gqlgen_e2e; | |
| CREATE DATABASE golang_clean_architecture_ent_gqlgen_e2e CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; |