Documentation
¶
Index ¶
- type Manager
- type Option
- type Server
- type ServerOption
- func WithEndpoint(host string, port uint, prefix string) ServerOption
- func WithMeter(meter model.Meter) ServerOption
- func WithMiddlewareConfigs(defaults []byte) ServerOption
- func WithMiddlewares(mws ...api.Middleware) ServerOption
- func WithTLS(cert certutil.CertBundle, clientCAs ...*x509.Certificate) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface {
common.Service
common.Liveness
common.Readiness
common.Initializable
common.Daemon
Get(name string) (Server, error)
List() []Server
RegisterRouters(routers ...api.Router) error
RegisterMiddlewares(middlewares ...api.Middleware) error
// Add returns a Conflict for a name already added.
Add(name string, opts ...ServerOption) error
}
type ServerOption ¶
type ServerOption func(*server)
func WithEndpoint ¶
func WithEndpoint(host string, port uint, prefix string) ServerOption
func WithMeter ¶ added in v0.6.15
func WithMeter(meter model.Meter) ServerOption
WithMeter enables HTTP metrics; the meter is not a dependency, so a collector outage never takes down the listener.
func WithMiddlewareConfigs ¶ added in v0.6.1
func WithMiddlewareConfigs(defaults []byte) ServerOption
WithMiddlewareConfigs maps name to a switch (boolean) or config block; a WithMiddlewares entry without a key stays dormant.
func WithMiddlewares ¶ added in v0.6.0
func WithMiddlewares(mws ...api.Middleware) ServerOption
WithMiddlewares runs on every request, matched or not (e.g. cors), before RequestInfo exists.
func WithTLS ¶
func WithTLS(cert certutil.CertBundle, clientCAs ...*x509.Certificate) ServerOption
WithTLS serves https with cert, verifying a client certificate, when one is given, against clientCAs; none is asked for without them.