app

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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
}

func New

func New(config *viper.Viper, opts ...Option) Manager

type Option

type Option func(*manager)

func WithLogger

func WithLogger(logger log.Logger) Option

func WithMonitorInterval added in v0.3.0

func WithMonitorInterval(interval time.Duration) Option

func WithName

func WithName(name string) Option

func WithRestartDelay added in v0.3.0

func WithRestartDelay(delay time.Duration) Option

func WithRestartPolicy added in v0.3.0

func WithRestartPolicy(maxRetries int) Option

func WithShutdownTimeout added in v0.3.0

func WithShutdownTimeout(timeout time.Duration) Option

func WithSignalHandler added in v0.3.0

func WithSignalHandler(sig os.Signal, handler func()) Option

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

func (s *Stats) Healthcheck() error

func (*Stats) Uptime added in v0.3.0

func (s *Stats) Uptime() time.Duration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL