v1.0.8 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 11 Imported by: 1




This section is empty.


This section is empty.


func GracefulShutdown added in v1.0.6

func GracefulShutdown(server *http.Server)

GracefulShutdown accepts a server reference and triggers a graceful shutdown for it when either SIGINT or SIGTERM is received.

func Handler

func Handler(w http.ResponseWriter, r *http.Request, h Handle)

Handler receives an HTTP request and response and a handler function It manages timeouts and prometheus metrics

func NewServer added in v1.0.6

func NewServer(mux *http.ServeMux) *http.Server

NewServer returns an HTTP server ready to listen on the configured port and with logReq mixed in for logging.

func PromHTTPHandler added in v1.0.7

func PromHTTPHandler() http.Handler

PromHTTPHandler to expose the metrics, invoked in the golang runtime


type Handle

type Handle func(ctx context.Context, w http.ResponseWriter, r *http.Request) ([]byte, error)

Handle type receive the context elements of a HTTP request to process it

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL