callhome

package
v0.0.0-...-4afb59e Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Enable    = "enable"
	Frequency = "frequency"
)

Callhome related keys

Variables

View Source
var DefaultKVS = config.KVS{
	config.KV{
		Key:   Enable,
		Value: "off",
	},
	config.KV{
		Key:   Frequency,
		Value: "24h",
	},
}

DefaultKVS - default KV config for subnet settings

View Source
var (

	// HelpCallhome - provides help for callhome config
	HelpCallhome = config.HelpKVS{
		config.HelpKV{
			Key:         Enable,
			Type:        "on|off",
			Description: "set to enable callhome" + defaultHelpPostfix(Enable),
			Optional:    true,
		},
		config.HelpKV{
			Key:         Frequency,
			Type:        "duration",
			Description: "time duration between callhome cycles e.g. 24h" + defaultHelpPostfix(Frequency),
			Optional:    true,
		},
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Flag indicating whether callhome is enabled.
	Enable bool `json:"enable"`

	// The interval between callhome cycles
	Frequency time.Duration `json:"frequency"`
}

Config represents the subnet related configuration

func LookupConfig

func LookupConfig(kvs config.KVS) (cfg Config, err error)

LookupConfig - lookup config and override with valid environment settings if any.

func (*Config) Enabled

func (c *Config) Enabled() bool

Enabled - indicates if callhome is enabled or not

func (*Config) FrequencyDur

func (c *Config) FrequencyDur() time.Duration

FrequencyDur - returns the currently configured callhome frequency

func (*Config) Update

func (c *Config) Update(ncfg Config)

Update updates new callhome frequency

Jump to

Keyboard shortcuts

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