Download from go lang.
After save global path
echo 'export GOROOT=/usr/local/go' >> ~/.zshrc
echo 'export PATH=$GOROOT/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
Create a database and user with privileges.
docker run --name my-mysql \
-e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_DATABASE=gigbuddy \
-e MYSQL_USER=admin \
-e MYSQL_PASSWORD=admin \
-p 3306:3306 \
-d mysql:latest
docker exec -it mysql-server mysql -u root -p
We use goose for migrations with MySQL.
go install github.com/pressly/goose/v3/cmd/goose@latest
First step set environment variables:
export GOOSE_DRIVER=mysql
export GOOSE_DBSTRING="root:root@tcp(localhost:3306)/gigbuddy?parseTime=true"
export GOOSE_MIGRATIONS_DIR=migrations
Create a new migration:
goose -s -dir migrations create <your_migration_name> sql
Run migrations:
goose -s -dir migrations up
Check migrations:
goose -s -dir migrations status
Swagger docs are available at http://localhost:8080/docs
When you change the code you need to run the following command to update the docs:
swag init -g server.go
Please contact admin for firebase config files.
For before launch script to work you need to make it executable.
chmod +x sh/before_launch.sh