Documentation ¶
Overview ¶
Package serve provides helpers to start and shutdown network services.
Index ¶
- func HTTP(ctx Ctx, addr netx.Addr, tlsConfig *tls.Config, handler http.Handler, ...) error
- func HandleMetrics(mux *http.ServeMux, reg *prometheus.Registry)
- func Metrics(ctx Ctx, addr netx.Addr, reg *prometheus.Registry) error
- func OpenAPI(ctx Ctx, srv OpenAPIServer, service string) error
- type Ctx
- type OpenAPIServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTP ¶
func HTTP(ctx Ctx, addr netx.Addr, tlsConfig *tls.Config, handler http.Handler, service string) error
HTTP starts HTTP server on addr using handler logged as service. It runs until failed or ctx.Done.
func HandleMetrics ¶ added in v1.4.0
func HandleMetrics(mux *http.ServeMux, reg *prometheus.Registry)
HandleMetrics adds reg's prometheus handler on /metrics at mux.
Types ¶
Click to show internal directories.
Click to hide internal directories.