signald

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: BSD-3-Clause Imports: 8 Imported by: 1

README

signald

The os.Signal monitor module

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KillSignals   = []os.Signal{syscall.SIGINT, syscall.SIGTERM}
	RestartSignal os.Signal
)

Functions

func Done

func Done(f ...func(sig os.Signal))

func Restartable

func Restartable()

func Restarts

func Restarts(f ...func(sig os.Signal))

func Start

func Start()

func Stop

func Stop()

func Wait

func Wait()

Types

type Binder

type Binder struct {
	Callback func(os.Signal)
	Unbind   func(f func())
}

type BinderInterface

type BinderInterface interface {
	SignalBinder() Binder
}

type Monitor

type Monitor struct {
	Log logging.Logger
	// contains filtered or unexported fields
}

func AutoBind

func AutoBind(binder Binder) *Monitor

func AutoBindInterface

func AutoBindInterface(binder BinderInterface) *Monitor

func Bind

func Bind(f ...func(os.Signal)) *Monitor

func Unbind

func Unbind(f ...func(os.Signal)) *Monitor

func (*Monitor) AutoBind

func (this *Monitor) AutoBind(binder Binder) *Monitor

func (*Monitor) Bind

func (this *Monitor) Bind(f func(sig os.Signal)) *Monitor

func (*Monitor) Done

func (this *Monitor) Done(f func(sig os.Signal))

func (*Monitor) Restartable

func (this *Monitor) Restartable()

func (*Monitor) Restarts

func (this *Monitor) Restarts(f func(sig os.Signal))

func (*Monitor) Start

func (this *Monitor) Start(sig ...os.Signal)

func (*Monitor) Stop

func (this *Monitor) Stop()

func (*Monitor) Unbind

func (this *Monitor) Unbind(f func(os.Signal)) *Monitor

func (*Monitor) Wait

func (this *Monitor) Wait()

Jump to

Keyboard shortcuts

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