SignalHandler

package module
v0.0.0-...-10c38ae Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SignalHandler

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

SignalHandler is a basic, abstract signal handler that is implementable in most go applications without much effort

func ConstructSignalHandler

func ConstructSignalHandler() *SignalHandler

ConstructSignalHandler will create a new SignalHandler

func (*SignalHandler) Listen

func (handler *SignalHandler) Listen()

Listen will wait for signals to come in, go through registered signal functions and execute them

func (*SignalHandler) RegisterSignalFunction

func (handler *SignalHandler) RegisterSignalFunction(sig os.Signal, callback func() error)

RegisterSignalFunction allows you to specify a function to be called when a signal is received by the signal handler

func (*SignalHandler) SetOutput

func (handler *SignalHandler) SetOutput(outputFunction func(v ...interface{}))

SetOutput will set the output function used to print errors should they occurr

func (*SignalHandler) Start

func (handler *SignalHandler) Start()

Start will listen, async, in a seperate go-routine.

Jump to

Keyboard shortcuts

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