types

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enabler

type Enabler interface {
	Enabled() bool
}

Enabler is the interface that provides enabled state of a service.

type HealthChecker

type HealthChecker interface {
	Name() string
	Interval() time.Duration
	Healthy(ctx context.Context) error
}

HealthChecker provides functionality to check health of any entity that implements this interface.

type IService

type IService interface {
	Name() string
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

IService is the interface that wraps the basic service lifecycle methods.

type ServiceState added in v0.4.0

type ServiceState int

ServiceState represents the current lifecycle state of a service.

const (
	// ServiceStateIdle means the service has been registered but not started.
	ServiceStateIdle ServiceState = iota
	// ServiceStateStarting means the service Start func is running.
	ServiceStateStarting
	// ServiceStateRunning means the service started successfully and is running.
	ServiceStateRunning
	// ServiceStateStopping means the service Stop func is running.
	ServiceStateStopping
	// ServiceStateStopped means the service stopped cleanly.
	ServiceStateStopped
	// ServiceStateFailed means the service exited with an error.
	ServiceStateFailed
)

func (ServiceState) String added in v0.4.0

func (s ServiceState) String() string

type StateProvider added in v0.4.0

type StateProvider interface {
	Name() string
	State() ServiceState
}

StateProvider exposes the current lifecycle state of a named component.

Jump to

Keyboard shortcuts

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