Go Backend Template

Examples

Layer Package Implementations
internal database (pgx + goqu) Client,
Service,
Transaction,
UserRepository
internal model (ozzo-validation) User
internal dto AddUser,
User,
LoginUser,
LoggedUser,
internal usecase Auth,
User,
Transaction (usecase example with transaction)
api http (gin) Server,
Router
config config Config
cmd http/main Main file

Makefile

$ make

Usage: make [command]

Commands:
 build-http                    Build http server

 migration-create name={name}  Create migration
 migration-up                  Up migrations
 migration-down                Down last migration

 docker-up                     Up docker services
 docker-down                   Down docker services

 fmt                           Format source code

Requirements:
 docker-compose                Docker Compose CLI: https://docs.docker.com/compose/reference
 migrate                       Migration CLI tool: https://github.com/golang-migrate/migrate

Request Collection

License

This project is licensed under the MIT License.

GitHub

View Github