watchdog

package
v1.32.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheckFn

type HealthCheckFn func(context.Context, time.Duration) error

HealthCheckFn is the health checker function type definition.

type Systemd

type Systemd interface {
	WatchdogEnabled() (time.Duration, error)
	Notify(string) (bool, error)
}

Systemd is the main interface for supported systemd functionality.

func DefaultSystemd

func DefaultSystemd() Systemd

DefaultSystemd returns the default systemd implementation.

type Watchdog

type Watchdog struct {
	// contains filtered or unexported fields
}

Watchdog is the main structure for this package.

func New

func New(healthCheckers ...HealthCheckFn) *Watchdog

New creates a new systemd Watchdog instance.

func (*Watchdog) Notifications

func (w *Watchdog) Notifications() uint64

Notifications returns the amount of done systemd notifications.

func (*Watchdog) Start

func (w *Watchdog) Start(ctx context.Context) error

Start runs the watchdog.

Jump to

Keyboard shortcuts

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