Documentation
¶
Overview ¶
Package health provides health check functionality for the flightctl-agent. Used by greenboot to verify agent health during boot.
Index ¶
- Variables
- func NewChecker(log *log.PrefixLogger, opts ...Option) *checker
- type Option
- func WithManagementCertPath(path string) Option
- func WithOutput(w io.Writer) Option
- func WithPollInterval(d time.Duration) Option
- func WithStabilityWindow(d time.Duration) Option
- func WithSystemdClient(systemd *client.Systemd) Option
- func WithTimeout(t time.Duration) Option
- func WithVerbose(v bool) Option
Constants ¶
This section is empty.
Variables ¶
var DefaultManagementCertPath = filepath.Join(agentconfig.DefaultDataDir, agentconfig.DefaultCertsDirName, agentconfig.GeneratedCertFile)
DefaultManagementCertPath is the default path to the management certificate issued during enrollment.
Functions ¶
func NewChecker ¶
func NewChecker(log *log.PrefixLogger, opts ...Option) *checker
NewChecker creates a new health checker with the given options.
Types ¶
type Option ¶
type Option func(*checker)
Option is a functional option for configuring the checker.
func WithManagementCertPath ¶ added in v1.4.0
WithManagementCertPath sets the path to the management certificate used to determine enrollment state.
func WithOutput ¶
WithOutput sets the output writer for messages.
func WithPollInterval ¶ added in v1.3.0
WithPollInterval sets how often the service status is polled.
func WithStabilityWindow ¶
WithStabilityWindow sets the duration the service must remain stable.
func WithSystemdClient ¶
WithSystemdClient sets a custom systemd client (for testing).
func WithTimeout ¶
WithTimeout sets the timeout for waiting for the service to become active.