Documentation ¶
Index ¶
- Variables
- type Once
- func (once *Once) Healthy() error
- func (once *Once) IfNotStopped(f func()) (ok bool)
- func (once *Once) IfStarted(f func()) (ok bool)
- func (once *Once) Ready() error
- func (once *Once) StartOnce(name string, fn func() error) error
- func (once *Once) State() State
- func (once *Once) StopOnce(name string, fn func() error) error
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyStopped = errors.New("already stopped") ErrCannotStopUnstarted = errors.New("cannot stop unstarted service") )
Functions ¶
This section is empty.
Types ¶
type Once ¶
Once contains a State integer
func (*Once) Healthy ¶
Healthy returns ErrNotStarted if the state is not started. Override this per-service with more specific implementations.
func (*Once) IfNotStopped ¶
IfNotStopped runs the func and returns true if in any state other than Stopped
func (*Once) IfStarted ¶
IfStarted runs the func and returns true only if started, otherwise returns false
Click to show internal directories.
Click to hide internal directories.