Documentation ¶
Overview ¶
Package app exposes a http server to run the API app.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a simple http app server. Simple, but extensible.
For a more capable wrapper (with trace & metrics exporters, graceful shutdown...), checkout github.com/casualjim/go-appserver or similar alternatives.
We can use this wrapper to initialize other components, e.g. auth middleware etc.
func NewServer ¶
NewServer builds a new instance of the API server.
There is a 2-stage warming-up: (i) Init() (ii) Start(). Stages are separated to be able to extend the capabilities with hot reload.
func (*Server) Init ¶
Init warms up the server by preparing things such as database connection pools, dependent API clients, etc.