infrasystem

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithShutdownCallback

func WithShutdownCallback(fn func(ctx context.Context)) Option

func WithShutdownGracePeriod

func WithShutdownGracePeriod(timeout time.Duration) Option

func WithShutdownTimeout

func WithShutdownTimeout(timeout time.Duration) Option

type Signals

type Signals struct {
	// contains filtered or unexported fields
}

func NewDefaultSignals

func NewDefaultSignals(op *infraoperator.Operator, opts ...Option) *Signals

NewDefaultSignals creates signal controller with the following signals handlers:

SIGTERM, SIGINT, SIGQUIT - shut down program
SIGHUP - reload configuration
SIGUSR1 - ignored

func NewSignals

func NewSignals(op *infraoperator.Operator, opts ...Option) *Signals

func (*Signals) Add

func (s *Signals) Add(si os.Signal, handler func())

Add - adds signal handler

func (*Signals) Ignore

func (s *Signals) Ignore(si os.Signal)

Ignore - adds signal to signal ignore list

func (*Signals) Reload

func (s *Signals) Reload()

Reload is a signal handler that reloads configuration

func (*Signals) Remove

func (s *Signals) Remove(si os.Signal)

Remove - removes signal handler

func (*Signals) Shutdown

func (s *Signals) Shutdown()

Shutdown is a signal handler that initializes system shutdown

func (*Signals) Wait

func (s *Signals) Wait()

Wait polls for signals

Jump to

Keyboard shortcuts

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