Documentation
¶
Overview ¶
Package common contains helper functions and calls that don't belong to other parts of the project.
Index ¶
- Variables
- func GeneratePingMessage(logger *zap.Logger, hostName string, in *api.Message, ...) *api.Message
- func ProcessPingMessage(logger *zap.Logger, stream streamServer, hostName string, in *api.Message, ...) error
- func ProcessWatchdog(ctx context.Context, cancel context.CancelFunc, cfg config.Conf, ...) func() error
- func StateReaper(ctx context.Context, cfg config.Conf, logger *zap.Logger, st state.State) func() error
- func WaitForOSSignal(ctx context.Context, cancel context.CancelFunc, cfg config.Conf, ...) func() error
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.