Categorygithub.com/shihabmridha/golang-app-template
module
0.0.0-20240613162732-6688ee0b920f
Repository: https://github.com/shihabmridha/golang-app-template.git
Documentation: pkg.go.dev

# README

Golang App Template

An app template to write application in go. It can be rest api, gRPC or whatever.

Prerequisite

  • VSCode
  • Go (1.22.0 or later)
  • make

Environment setup

Create a .env file. See .env-example for reference.

Install goose for database migration.

go install github.com/pressly/goose/v3/cmd/goose@latest

Run go run ./cmd/api to start the api server.

The server can be accessed in this url: http://localhost:3000

Migration

All the migration files are stored in internal/migrations directory.

Create a new migration file.

make mg-new name=user_table

Apply all available migrations

make mg-up

Revert single migration from current version

make mg-down

To check migration status.

make mg-status

Note: For local database we might need to remove tls=skip-verify from the connection string

# Packages

No description provided by the author
No description provided by the author