common

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package common contains helper functions and calls that don't belong to other parts of the project.

Index

Constants

This section is empty.

Variables

View Source
var ErrSignalReceived = errors.New("signal received")

ErrSignalReceived is returned when an interrupt or term signal is received.

View Source
var ErrWatchdogFailed = errors.New("systemd watchdog failed")

ErrWatchdogFailed is returned when the systemd watchdog tick fails.

Functions

func GeneratePingMessage added in v0.5.0

func GeneratePingMessage(
	logger *zap.Logger,
	hostName string,
	in *api.Message,
	msg *api.Message_PingMessage,
) *api.Message

GeneratePingMessage is a common handler for generating PingMessage messages.

func ProcessPingMessage

func ProcessPingMessage(
	logger *zap.Logger,
	stream streamServer,
	hostName string,
	in *api.Message,
	msg *api.Message_PingMessage,
) error

ProcessPingMessage is a common handler for processing PingMessage messages.

func ProcessWatchdog

func ProcessWatchdog(ctx context.Context, cancel context.CancelFunc, cfg config.Conf, logger *zap.Logger) func() error

ProcessWatchdog sends systemd watchdog heartbeats to the systemd process.

func StateReaper added in v0.6.1

func StateReaper(
	ctx context.Context,
	cfg config.Conf,
	logger *zap.Logger,
	st state.State,
) func() error

StateReaper periodically checks the state store and deactivates old entries.

func WaitForOSSignal

func WaitForOSSignal(
	ctx context.Context,
	cancel context.CancelFunc,
	cfg config.Conf,
	logger *zap.Logger,
	c chan os.Signal,
) func() error

WaitForOSSignal listens for a signal from the OS that the system is shutting down and sets the display to "DEAD".

Types

This section is empty.

Jump to

Keyboard shortcuts

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