Go (Golang) JWTAuth with Gin Framework

1. Project Description

  1. JWT authentication
  2. Next tutorial is building secret manager

2. Run with Docker

  1. Build

make build
docker build . -t auth-server
  1. Run

docker-compose up 
docker run -p 5000:5000 auth-server
  1. Useful Commands

make run 
make test
make scan
make build

3. Generate Docs

# Get swag go 1.16 or newer
go install github.com/swaggo/swag/cmd/[email protected]
# Get swag go bellow 1.16
go get -u github.com/swaggo/swag/cmd/swag
# Generate docs
swag init --dir cmd/api --parseDependency --output docs
or Make sure to import the generated docs/docs.go so that your specific configuration gets init'ed. If your General API annotations do not live in main.go, you can let swag know with -g flag.
swag init -g http/api.go 
Run go linter and scanner: make scan


View Github