config

package
v0.0.0-...-48dd7fe Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	SharedConfig

	// PingFrequency is the amount of time between pings
	PingFrequency time.Duration `split_words:"true" default:"1m"`

	// ServerAddress is the address of the server to ping
	ServerAddress string `split_words:"true" required:"true"`

	// HostIdentifier is the identifier for this host.
	// If omitted, the host's hostname will be used.
	HostIdentifier string `split_words:"true"`
}

func LoadAgentConfig

func LoadAgentConfig() (*AgentConfig, error)

type ServerConfig

type ServerConfig struct {
	SharedConfig

	// ListenAddress is the address to listen on
	ListenAddress string `split_words:"true" default:":8080"`

	// UnhealthyTime is the amount of time since last ping before a host is marked unhealthy
	UnhealthyTime time.Duration `split_words:"true" default:"5m"`

	// UpdateFrequency is the amount of time between status updates
	UpdateFrequency time.Duration `split_words:"true" default:"1m"`

	// InstatusKey is the API key for Instatus
	InstatusKey string `split_words:"true" required:"true"`

	// InstatusTargetSubdomain is the Instatus subdomain to submit statuses to
	TargetSubdomain string `split_words:"true" required:"true"`
}

func LoadServerConfig

func LoadServerConfig() (*ServerConfig, error)

type SharedConfig

type SharedConfig struct {
	// LogLevel is the log level to use
	LogLevel string `split_words:"true" default:"info"`

	// SharedSecret is the secret to use to authenticate with the server
	SharedSecret string `split_words:"true" required:"true"`
}

Jump to

Keyboard shortcuts

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