package gracehttp

import "github.com/facebookgo/grace/gracehttp"

Package gracehttp provides easy to use graceful restart functionality for HTTP server.

Index

Functions

func PreStartProcess

func PreStartProcess(hook func() error) option

PreStartProcess configures a callback to trigger during graceful restart directly before starting the successor process. This allows the current process to release holds on resources that the new process will need.

func Serve

func Serve(servers ...*http.Server) error

Serve will serve the given http.Servers and will monitor for signals allowing for graceful termination (SIGTERM) or restart (SIGUSR2).

func ServeWithOptions

func ServeWithOptions(servers []*http.Server, options ...option) error

ServeWithOptions does the same as Serve, but takes a set of options to configure the app struct.

func SetLogger

func SetLogger(l *log.Logger)

SetLogger sets logger to be able to grab some useful logs

Source Files

http.go

Version
v0.0.0-20180706040059-75cf19382434 (latest)
Published
Jul 6, 2018
Platform
js/wasm
Imports
12 packages
Last checked
3 weeks ago

Tools for package owners.