config

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReloadFunc added in v0.20.0

func NewReloadFunc(
	filePath string,
	skipTLS bool,
	version string,
	logger *slog.Logger,
	dispatcher *notifier.Dispatcher,
	mgr *heartbeat.Manager,
) func() error

NewReloadFunc builds a reload function with logging and serialization.

func Reload added in v0.20.0

func Reload(
	filePath string,
	skipTLS bool,
	version string,
	logger *slog.Logger,
	dispatcher *notifier.Dispatcher,
	mgr *heartbeat.Manager,
) (heartbeat.ReconcileResult, error)

Reload loads, validates, and applies the config to the dispatcher and manager.

func WatchReload added in v0.20.0

func WatchReload(ctx context.Context, reloadCh <-chan os.Signal, logger *slog.Logger, reloadFn func() error)

WatchReload listens for reload signals and invokes the reload function.

Types

type Config

type Config struct {
	Receivers  map[string]notifier.ReceiverConfig `yaml:"receivers"`  // Receivers is the map of receiver IDs to their configurations.
	Heartbeats heartbeat.HeartbeatConfigMap       `yaml:"heartbeats"` // Heartbeats is the map of heartbeat IDs to their configurations.
}

Config is the top-level configuration.

func LoadConfig

func LoadConfig(filePath string) (*Config, error)

LoadConfig loads configuration from a YAML file.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that each heartbeat references an existing receiver and validates and resolves secrets in receiver configurations.

Jump to

Keyboard shortcuts

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