Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCleanExit is returned by Start() when the program is interrupted before starting. This can happen for example, when using the "--help" flag. ErrCleanExit = errors.New("clean exit requested") )
Functions ¶
func ShuttingDown ¶
func ShuttingDown() <-chan struct{}
ShuttingDown returns a channel read on the global shutdown signal.
func Start ¶
func Start() error
Start starts all modules in the correct order. In case of an error, it will automatically shutdown again.
func StartCompleted ¶
func StartCompleted() bool
StartCompleted returns whether starting has completed.
func WaitForStartCompletion ¶
func WaitForStartCompletion() <-chan struct{}
WaitForStartCompletion returns as soon as starting has completed.
Types ¶
type Module ¶
type Module struct { Name string Prepped *abool.AtomicBool Started *abool.AtomicBool Stopped *abool.AtomicBool // contains filtered or unexported fields }
Module represents a module.
func (*Module) ReadyToPrep ¶
ReadyToPrep returns whether all dependencies are ready for this module to prep.
func (*Module) ReadyToStart ¶
ReadyToStart returns whether all dependencies are ready for this module to start.
func (*Module) ReadyToStop ¶
ReadyToStop returns whether all dependencies are ready for this module to stop.
Click to show internal directories.
Click to hide internal directories.