Documentation ¶
Overview ¶
Package posixsignal provides a listener for a posix signal. By default it listens for SIGINT and SIGTERM, but others can be chosen in NewPosixSignalManager. When ShutdownFinish is called it exits with os.Exit(0)
Index ¶
Constants ¶
const Name = "PosixSignalManager"
Name defines shutdown manager name.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PosixSignalManager ¶
type PosixSignalManager struct {
// contains filtered or unexported fields
}
PosixSignalManager implements ShutdownManager interface that is added to GracefulShutdown. Initialize with NewPosixSignalManager.
func NewPosixSignalManager ¶
func NewPosixSignalManager(sig ...os.Signal) *PosixSignalManager
NewPosixSignalManager initializes the PosixSignalManager. As arguments you can provide os.Signal-s to listen to, if none are given, it will default to SIGINT and SIGTERM.
func (*PosixSignalManager) GetName ¶
func (posixSignalManager *PosixSignalManager) GetName() string
GetName returns name of this ShutdownManager.
func (*PosixSignalManager) ShutdownFinish ¶
func (posixSignalManager *PosixSignalManager) ShutdownFinish() error
ShutdownFinish exits the app with os.Exit(0).
func (*PosixSignalManager) ShutdownStart ¶
func (posixSignalManager *PosixSignalManager) ShutdownStart() error
ShutdownStart does nothing.
func (*PosixSignalManager) Start ¶
func (posixSignalManager *PosixSignalManager) Start(gs shutdown.GSInterface) error
Start starts listening for posix signals.