Single binary web application generator for Go.
Creates boilerplate and does routine on a project start.
Less than in a minute you've got simple, clean and dockerized app:
- project layout, according to community best practices
- Makefile for wrapping project related routines
- Dockerfile and docker-compose for local development
- containers for code, tests and golangci-lint
- configuration management with viper
- logging with logrus or zap
- routing with gorilla/mux or chi
- default health check, http handler and logger middleware
go-wagen is a starter pack for typical web application in Golang.
It doesn't aim to generalize the whole project workflow, push framework, or architecture. Consists of framework-agnostic components that are very common.
All contributions, issues, requests or feedback are warmly welcome.
Install pre-built binary on releases page:
curl -LJO https://github.com/groovili/go-wagen/releases/download/v1.0.0/go-wagen-osx.tar.gz
tar -f go-wagen-osx.tar.gz -x
or build from source code:
git clone https://github.com/groovili/go-wagen && cd go-wagen
make install
- will install packr to wrap templates to binarymake build
Binary doesn't need to be in $GOPATH
and works without any dependencies.
./go-wagen --path=/absoule/path/to/project
and select dependenciescd /absoule/path/to/project
go mod vendor
make run
- will build and run container with codemake test
- to run container with testsmake lint
- to run linter for source code
Application generated with go-wagen will have following structure:
├── Makefile
├── cmd
│ └── example
│ └── example.go - app entrypoint
├── config - config presets for each env of default pipline
│ ├── app.dev.yml
│ ├── app.local.yml
│ └── app.yml
├── deploy
│ ├── Dockerfile
│ └── docker-compose.yml
├── go.mod
├── internal - for shared internal tools
├── server
│ ├── handlers
│ │ ├── hello.go
│ │ └── ping.go
│ └── middleware
│ └── log.go
├── storage - db/storages
└── vendor - downloaded modules