Golang microservices. Task for "two hours".
$ go get github.com/Alma-media/eop09
- server:
$ go run main.go -port 5050
- client:
$ go run main.go -file path/to/file -grpc-addr localhost:5050 -http-port 8080
- API
- HTTPs support
- advanced routing
- http middleware (jwt, auth, timeout etc)
- enable codec middleware and retrieve codec from the context to use corresponding encoder
- pass logger to the handler (intermal errors should be logged but not exposed to the user)
- Config
- introduce config
struct
and use a library to parse the values from flags, toml, yaml, json, hcl ...
- Service
- TLS
- server side interceptors
- register reflection API
- graceful shutdown
- Storage
- choose another storage implementation that uses the context and is able to fail / return an error (e.g. database, blockchain etc)