httpx

package module
v0.0.0-...-544aadc Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 6 Imported by: 2

README

go-httpx

Useful extensions around Go's net/http package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GracefulShutdownServerOnSignal

func GracefulShutdownServerOnSignal(server *http.Server, signalLog, errorLog Logger, timeout time.Duration, signals ...os.Signal)

GracefulShutdownServerOnSignal shuts down the passed server gracefully after the process was notified with any of the passed signals. The server is guaranteed to shut down with the passed timeout after a signal. A timeout value of zero disables the timeout. If no signals are passed, then SIGHUP, SIGINT, SIGTERM will be used. If signalLog is not nil, then the received signal will be logged with it. If errorLog is not nil, then any errors from the server shutdown will be logged with it.

Types

type Logger

type Logger interface {
	Printf(format string, args ...any)
}

Directories

Path Synopsis
Package contenttype exports MIME content-type constants.
Package contenttype exports MIME content-type constants.

Jump to

Keyboard shortcuts

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