config

package
v0.2024.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultDebounce = 15 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Root

type Root struct {
	auto.Config
	// Name of the device that stores the alerts.
	// Must implement AlertAdminApi.
	Destination string `json:"destination,omitempty"`
	// If true, all devices on the current node that implement Status will be monitored.
	// Additional sources may be defined via Sources.
	DiscoverSources bool `json:"discoverSources,omitempty"`
	// Name of the devices that implement Status trait and that are monitored.
	Sources []Source `json:"sources,omitempty"`
	// Delay querying the status of devices by this much, to allow them to boot up.
	DelayStart *jsontypes.Duration `json:"delayStart,omitempty"`
	// Default debounce time for all sources.
	Debounce *jsontypes.Duration `json:"debounce,omitempty"`
	// Device name prefixes to ignore.
	// Only used if DiscoverSources is true.
	IgnorePrefixes []string `json:"ignorePrefixes,omitempty"`
}

func ReadBytes

func ReadBytes(data []byte) (cfg Root, err error)

type Source

type Source struct {
	Name      string `json:"name,omitempty"`
	Floor     string `json:"floor,omitempty"`
	Zone      string `json:"zone,omitempty"`
	Subsystem string `json:"subsystem,omitempty"`

	// Don't record alerts until after this time expires, reduces noise.
	Debounce *jsontypes.Duration `json:"debounce,omitempty"`
}

func (Source) DebounceOrDefault

func (s Source) DebounceOrDefault() time.Duration

Jump to

Keyboard shortcuts

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