Documentation ¶
Overview ¶
Package http provides opinionated production-ready HTTP server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*options)
Option configures the http server.
func WithAddress ¶
WithAddress provides the address listened by the HTTP server. It should be either tcp address like `:8080` or unix socket address like `unix:nilgo.sock`.
By default, it listens on `localhost:8080` or `:${PORT}` if the environment variable exists.
func WithConfigService ¶
WithConfigService registers the endpoint `_config/{path}` for config explanation.
It uses the global konf.Config if the configs are not provided.
func WithTimeout ¶
WithTimeout provides the duration that timeout http request.
By default, it has 10 seconds timeout.
Click to show internal directories.
Click to hide internal directories.