posixsignal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 4 Imported by: 0

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

View Source
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.

Jump to

Keyboard shortcuts

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