death.v2: gopkg.in/vrecan/death.v2 Index | Files

package death

import "gopkg.in/vrecan/death.v2"

Index

Package Files

death.go

type Death Uses

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

Death manages the death of your application.

func NewDeath Uses

func NewDeath(signals ...os.Signal) (death *Death)

NewDeath Create Death with the signals you want to die from.

func (*Death) FallOnSword Uses

func (d *Death) FallOnSword()

FallOnSword manually initiates the death process.

func (*Death) SetLogger Uses

func (d *Death) SetLogger(l Logger) *Death

SetLogger Overrides the default logger (seelog)

func (*Death) SetTimeout Uses

func (d *Death) SetTimeout(t time.Duration) *Death

SetTimeout Overrides the time death is willing to wait for a objects to be closed.

func (*Death) WaitForDeath Uses

func (d *Death) WaitForDeath(closable ...io.Closer)

WaitForDeath wait for signal and then kill all items that need to die.

func (*Death) WaitForDeathWithFunc Uses

func (d *Death) WaitForDeathWithFunc(f func())

WaitForDeathWithFunc allows you to have a single function get called when it's time to kill your application.

type Logger Uses

type Logger interface {
    Error(v ...interface{})
    Debug(v ...interface{})
    Info(v ...interface{})
    Warn(v ...interface{})
}

Logger interface to log.

Package death imports 7 packages (graph). Updated 2018-03-27. Refresh now. Tools for package owners.