Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIDefinition ¶
APIDefinition is used to control lifecycle of the API
type HealthChecker ¶
type HealthChecker interface {
Healthy(w http.ResponseWriter, r *http.Request) error
}
HealthChecker is used to run a custom health check Implement it on your API if you want it to be checked when the healthcheck is called
type Opt ¶ added in v0.51.1
Opt will allow modification of the http server
func WithAddress ¶ added in v0.51.1
WithAddress will set the address field on the server
func WithHostAndPort ¶ added in v0.51.1
WithHostAndPort will use them in the form host:port as the address field on the server
func WithReadTimeout ¶ added in v0.51.1
WithReadTimeout will override the server's read timeout
func WithWriteTimeout ¶ added in v0.51.1
WithWriteTimeout will override the server's write timeout
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server handles the setup and shutdown of the http server for an API
func New ¶
func New(log logrus.FieldLogger, config Config, api APIDefinition) (*Server, error)
New will build a server with the defaults in place
func NewOpts ¶ added in v0.51.1
func NewOpts(log logrus.FieldLogger, api APIDefinition, opts ...Opt) (*Server, error)
NewOpts will create the server with many defaults. You can use the opts to override them. the one major default you can't change by this is the health path. This is set to /health and be enabled.