go-rest-api
go-rest-api copied to clipboard
Example golang using gin framework everything you need, i create this tutorial special for beginner.
Golang Gin Framework Fundamental
Example golang using gin framework everything you need, i create this tutorial special for beginner.
Feature
- [x] Containerize Application Using Docker
- [x] Protected Route Using JWT
- [x] Integerasi ORM Database Using Gorm
- [x] API Documentation Using Swagger
- [x] Validation Request Using Go Playground Validator
- [x] Integerasi Unit Testing
- [x] And More
Command
-
Application Lifecycle
- Install node modules
$ go get . || go mod || make goinstall
- Build application
$ go build -o main || make goprod
- Start application in development
$ go run main.go | make godev
- Test application
$ go test main.go main_test.go || make gotest
-
Docker Lifecycle
- Build container
$ docker-compose build | make dcb
- Run container with flags
$ docker-compose up -d --<flags name> | make dcu f=<flags name>
- Run container build with flags
$ docker-compose up -d --build --<flags name> | make dcubf f=<flags name>
- Run container
$ docker-compose up -d --build | make dcu
- Stop container
$ docker-compose down | make dcd