- Router
- Controllers for both HTTP and GRPC
- Request Validators
- Auth Middleware
- DB
- Postgres
- CLI
- DB Migrations
- Client SDK
- Promethesus/Grafana Dashboards
- Must be easily extendible
- Should be able to add databases, caching and change DBs easily
- Should be easily tested
- Should be able to test business logic separately from DB
- Should not overly abstract, but should be abstract enough to be testable
- i.e. only abstract what you need to
- https://eli.thegreenplace.net/2019/simple-go-project-layout-with-modules/
pkg
is antipattern- Put stuff into
internal
if you can.
- https://github.com/golang/go
- https://itnext.io/golang-and-clean-architecture-19ae9aae5683
- https://rakyll.org/style-packages/
- No plurals
httputil
nothttputils
- clean import paths (no
src
) - organize by functional responsibilities
mngtservice
overmodels
- No plurals