Versions in this module Expand all Collapse all v0 v0.1.0 May 28, 2026 Changes in this version type Lifecycle + func (l *Lifecycle) Add(r Runner) + type Runner interface + Run func(ctx context.Context) error + type RunnerFunc func(ctx context.Context) error + func (r RunnerFunc) Run(ctx context.Context) error v0.0.2 Feb 28, 2023 v0.0.1 Feb 26, 2023 Changes in this version + var DefaultConfig = Config + var DefaultShutdownConfig = ShutdownConfig + var NopLogger = nopLogger + type Config struct + ShutdownTimeout time.Duration + StartStrategy StartStrategy + StartupTimeout time.Duration + type Lifecycle struct + func New(config Config) *Lifecycle + func (l *Lifecycle) Close() error + func (l *Lifecycle) RegisterService(service types.ServiceConfig) + func (l *Lifecycle) RegisterShutdownHook(name string, h types.ShutdownHook) + func (l *Lifecycle) RegisterStartupHook(name string, h types.StartupHook) + func (l *Lifecycle) Start() error + func (l *Lifecycle) Statuses() []ServiceState + func (l *Lifecycle) Stop() error + func (l *Lifecycle) SubscribeMonitor(ch chan<- []ServiceState) Subscription + type Logger interface + Printf func(format string, v ...interface{}) + type ServiceState struct + Error error + ID int + Name string + Status types.ServiceStatus + func (s ServiceState) String() string + type ShutdownConfig struct + ExitOnShutdown bool + type SignalHandler struct + func NewSignalHandler(lifecycle *Lifecycle, logger Logger, signals ...os.Signal) *SignalHandler + func (h *SignalHandler) Start(cfg ShutdownConfig) + func (h *SignalHandler) Wait() (err error) + type StartStrategy int + const StartStrategyFailFast + const StartStrategyRollbackOnError + const StartStrategyStartAll + type StdLogger struct + func NewStdLogger(out io.Writer) *StdLogger + func (l *StdLogger) Printf(format string, v ...interface{}) + type Subscription interface + Cancel func()