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

package death

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

Index

Package Files

death.go deathlog.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) (err error)

WaitForDeath wait for signal and then kill all items that need to die. If they fail to die when instructed we return an error

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{})
}

Logger interface to log.

func DefaultLogger Uses

func DefaultLogger() Logger

DefaultLogger returns a logger that does nothing

Package death imports 8 packages (graph). Updated 2018-06-29. Refresh now. Tools for package owners.