shutdown

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GracefulServer

type GracefulServer struct {
	Server *http.Server
	Logger *zap.Logger
	// contains filtered or unexported fields
}

func (*GracefulServer) ListenAndServe

func (s *GracefulServer) ListenAndServe() (err error)

func (*GracefulServer) WaitForExitingSignal

func (s *GracefulServer) WaitForExitingSignal(timeout time.Duration)

type Hook

type Hook interface {
	// WithSignals add more signals into hook
	WithSignals(signals ...syscall.Signal) Hook

	// Close register shutdown handles
	Close(funcs ...func())
}

Hook a graceful shutdown hook, default with signals of SIGINT and SIGTERM

func NewHook

func NewHook() Hook

NewHook create a Hook instance

Jump to

Keyboard shortcuts

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