watchdog

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultWatchdogClient

type DefaultWatchdogClient struct{}

DefaultWatchdogClient implements the WatchdogClient interface using the actual systemd daemon functions.

func (*DefaultWatchdogClient) SdNotify

func (d *DefaultWatchdogClient) SdNotify(unsetEnvironment bool) (bool, error)

func (*DefaultWatchdogClient) SdWatchdogEnabled

func (d *DefaultWatchdogClient) SdWatchdogEnabled(unsetEnvironment bool) (time.Duration, error)

type HealthChecker

type HealthChecker interface {
	Start()
}

HealthChecker defines the interface of health checkers.

func NewHealthChecker

func NewHealthChecker(syncLoop syncLoopHealthChecker, opts ...Option) (HealthChecker, error)

NewHealthChecker creates a new HealthChecker instance. This function initializes the health checker and configures its behavior based on the status of the systemd watchdog. If the watchdog is not enabled, the function returns an error.

type Option

type Option func(*healthChecker)

Option defines optional parameters for initializing the healthChecker structure.

func WithExtendedCheckers

func WithExtendedCheckers(checkers []healthz.HealthChecker) Option

func WithWatchdogClient

func WithWatchdogClient(watchdog WatchdogClient) Option

type WatchdogClient

type WatchdogClient interface {
	SdWatchdogEnabled(unsetEnvironment bool) (time.Duration, error)
	SdNotify(unsetEnvironment bool) (bool, error)
}

WatchdogClient defines the interface for interacting with the systemd watchdog.

Jump to

Keyboard shortcuts

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