gracehttp

package
Version: v0.0.0-...-75cf193 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2018 License: MIT Imports: 12 Imported by: 286

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

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

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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