config

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// CommModePull Defines the string representing pull communication for check.
	CommModePull = "pull"
	// CommModePush Defines the string representing push communication for check.
	CommModePush = "push"
)

Variables

This section is empty.

Functions

func OverrideConfigFromEnvVars

func OverrideConfigFromEnvVars(c *Config) error

OverrideConfigFromEnvVars overrides config object with values setted in env vars.

func OverrideConfigFromOptions

func OverrideConfigFromOptions(c *Config)

OverrideConfigFromOptions overrides config object with values setted in env vars.

Types

type CheckConfig

type CheckConfig struct {
	Target           string `toml:"Target"`
	AssetType        string `toml:"AssetType"`
	Opts             string `toml:"Options"`
	CheckID          string `toml:"CheckID"`
	CheckTypeName    string `toml:"CheckTypeName"`
	CheckTypeVersion string `toml:"CheckTypeVersion"`
}

CheckConfig stores config information needed by a check.

type Config

type Config struct {
	Check           CheckConfig       `toml:"Check"`
	Log             LogConfig         `toml:"Log"`
	CommMode        string            `toml:"CommMode"`
	Push            rest.PusherConfig `toml:"Push"`
	AllowPrivateIPs *bool             `toml:"AllowPrivateIps"`
	RequiredVars    map[string]string `toml:"RequiredVars"`
}

Config holds all values regarding configuration.

func BuildConfig

func BuildConfig() (*Config, error)

BuildConfig builds a configuration struct by reading, if exists, the conf file and overriding the conf values from env vars.

func LoadConfigFromFile

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

LoadConfigFromFile loads configuration file from a path.

type LogConfig

type LogConfig struct {
	LogFmt   string `json:"log_fmt" toml:"LogFmt"`
	LogLevel string `json:"log_level" toml:"LogLevel"`
}

LogConfig defines configuration params for logging.

Jump to

Keyboard shortcuts

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