Documentation
¶
Index ¶
- type Manager
- type Option
- func WithLogger(logger log.Logger) Option
- func WithMonitorInterval(interval time.Duration) Option
- func WithName(name string) Option
- func WithRestartDelay(delay time.Duration) Option
- func WithRestartPolicy(maxRetries int) Option
- func WithShutdownTimeout(timeout time.Duration) Option
- func WithSignalHandler(sig os.Signal, handler func()) Option
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface {
common.Service
common.Initializable
common.Daemon
common.Debuggable
Register(services ...common.Service)
TopoSort() error
Services() []common.Service
Stats() ([]*Stats, error)
// Migrate() error
InitService(ctx context.Context, name string) error
StartService(name string) error
StopService(name string, wait bool) error
RestartService(ctx context.Context, name string) error
}
type Option ¶
type Option func(*manager)
func WithLogger ¶
func WithMonitorInterval ¶ added in v0.3.0
func WithRestartDelay ¶ added in v0.3.0
func WithRestartPolicy ¶ added in v0.3.0
func WithShutdownTimeout ¶ added in v0.3.0
func WithSignalHandler ¶ added in v0.3.0
type Stats ¶
type Stats struct {
Name string
Initialized bool
InitializedAt time.Time
InitializationErr error
Started bool
StartedAt time.Time
StartErr error
Stopped bool
StoppedAt time.Time
StopErr error
HealthcheckedAt time.Time
HealthcheckErr error
LivenessErr error
Ready bool
ReadinessErr error
Restarts int
RestartedAt time.Time
InitDuration time.Duration
StartDuration time.Duration
StopDuration time.Duration
// contains filtered or unexported fields
}
func (*Stats) Healthcheck ¶
Click to show internal directories.
Click to hide internal directories.