Documentation ¶
Overview ¶
Package graceful has tools for making graceful shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCallbackCnt = errors.New("invalid callbacks count, required only start and stop callbacks") //nolint:revive ErrStartFuncType = errors.New("invalid start func type") //nolint:revive ErrEmptyStartFunc = errors.New("empty start func") //nolint:revive ErrStopFuncType = errors.New("invalid stop func type") //nolint:revive ErrEmptyStopFunc = errors.New("empty stop func") //nolint:revive ErrEmptyListener = errors.New("undefined global listener") //nolint:revive )
Functions ¶
Types ¶
type CallbackWithError ¶
type CallbackWithError = func() error
CallbackWithError is a common function type with error.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener listens errorgroup goroutines.
func NewListener ¶
func NewListener(ctx context.Context, signals ...os.Signal) (*Listener, context.Context, context.CancelFunc)
NewListener create listener for os signals and registers cancel func and group context.
Click to show internal directories.
Click to hide internal directories.