Production grade fizzbuzz
The docker compose stack runs both the api, a small client written in typescript
using Deno
which emulates some load, and a godoc container rendering the package documentation.
The api container should be around 16Mo while the client
# running the stack
mv .env.example .env
docker compose up -d
- Mux/Routing/HttpBody: echo
- Logging: zap
- Testing: testify
- Config: envconfig
- go 1.20+ (generics)
- openapi3.json automatic generation at runtime
Contains various conveniences and helpers.
It can be refactored into its own package/applicative-framework if the core/config
package becomes more generalised, and not fizzbuzz
specific.
- errors: convenience error wrapper
- config: runtime config from environment + sane defaults
- http: generic handler + server abstraction
- logger: logging layer initialisation + helpers
- semconv: formatting keys and naming things
- generics: slice/maps generic utilities
Package for everything binary related: servers, migration runners, scripts...
server
: the actual http server
# see core/config/env.go for the complete list
# and default values
FIZZBUZZ_MODE=prod|dev
FIZZBUZZ_PORT=8080
# supersedes FIZZBUZZ_PORT
FIZZBUZZ_ADDR=:8080
# defaults to true
FIZZBUZZ_CORS_ENABLED=true|false