config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PullPolicies

func PullPolicies() []string

Types

type APIConfig

type APIConfig struct {
	Port  string `json:"port"`               // Port where the api for for the check should listen on
	IName string `json:"iname" toml:"iname"` // Interface name that defines the ip a check should use to reach the agent api.
	Host  string `json:"host" toml:"host"`   // Hostname a check should use to reach the agent. Overrides the IName config param.
}

APIConfig defines the configuration for the agent API.

type AgentConfig

type AgentConfig struct {
	LogLevel       string `toml:"log_level"`
	LogFile        string `toml:"log_file"`
	Timeout        int    `toml:"timeout"` // Timeout to start running a check.
	ConcurrentJobs int    `toml:"concurrent_jobs"`
	// MaxMsgsInterval defines the maximun time, in seconds, the agent can
	// running without reading any message from the queue.
	MaxNoMsgsInterval      int `toml:"max_no_msgs_interval"`
	MaxProcessMessageTimes int `toml:"max_message_processed_times"`
}

AgentConfig defines the higher level configuration for the agent.

type Auth

type Auth struct {
	Server string `toml:"server"`
	User   string `toml:"user"`
	Pass   string `toml:"pass"`
}

type CheckConfig

type CheckConfig struct {
	AbortTimeout int               `toml:"abort_timeout"` // Time to wait for a check container to stop gracefully.
	LogLevel     string            `toml:"log_level"`     // Log level for the check default logger.
	Vars         map[string]string `toml:"vars"`          // Environment variables to inject to checks.
}

CheckConfig defines the configuration for the checks.

type ClusterConfig

type ClusterConfig struct {
	Name   string `toml:"name"`
	Server string `toml:"server"`
}

ClusterConfig defines the configuration for the Kubernetes cluster.

type Config

type Config struct {
	Agent     AgentConfig    `toml:"agent"`
	Stream    StreamConfig   `toml:"stream"`
	Uploader  UploaderConfig `toml:"uploader"`
	SQSReader SQSReader      `toml:"sqs_reader"`
	SQSWriter SQSWriter      `toml:"sqs_writer"`
	API       APIConfig      `toml:"api"`
	Check     CheckConfig    `toml:"check"`
	Runtime   RuntimeConfig  `toml:"runtime"`
	DataDog   DatadogConfig  `toml:"datadog"`
}

Config represents the configuration for the agent.

func ReadConfig

func ReadConfig(configFile string) (Config, error)

ReadConfig reads and parses a configuration file.

type ContextConfig

type ContextConfig struct {
	Name      string `toml:"name"`
	Cluster   string `toml:"cluster"`
	Namespace string `toml:"namespace"`
	User      string `toml:"user"`
}

ContextConfig defines the configuration for the Kubernetes context.

type CredentialsConfig

type CredentialsConfig struct {
	Name  string `toml:"name"`
	Token string `toml:"token"`
}

CredentialsConfig defines the configuration for the Kubernetes user.

type DatadogConfig

type DatadogConfig struct {
	Enabled bool   `toml:"metrics_enabled"`
	Statsd  string `toml:"dogstatsd"`
}

DatadogConfig defines the configuration for DataDog.

type DockerConfig

type DockerConfig struct {
	Registry RegistryConfig `toml:"registry"`
}

DockerConfig defines the configuration for the Docker runtime environment.

type KubernetesConfig

type KubernetesConfig struct {
	Cluster     ClusterConfig     `toml:"cluster"`
	Context     ContextConfig     `toml:"context"`
	Credentials CredentialsConfig `toml:"credentials"`
}

KubernetesConfig defines the configuration for the Kubernetes runtime environment.

type PullPolicy

type PullPolicy int
const (
	PullPolicyIfNotPresent PullPolicy = iota
	PullPolicyAlways
	PullPolicyNever
)

func (*PullPolicy) MarshalText

func (a *PullPolicy) MarshalText() (text []byte, err error)

MarshalText returns string representation of a PullPolicy instance.

func (*PullPolicy) String

func (a *PullPolicy) String() (string, error)

func (*PullPolicy) UnmarshalText

func (a *PullPolicy) UnmarshalText(text []byte) error

UnmarshalText creates a PullPolicy from its string representation.

type RegistryConfig

type RegistryConfig struct {
	Auths               []Auth     `toml:"auths"`
	Server              string     `toml:"server"`
	User                string     `toml:"user"`
	Pass                string     `toml:"pass"`
	BackoffInterval     int        `toml:"backoff_interval"`
	BackoffMaxRetries   int        `toml:"backoff_max_retries"`
	BackoffJitterFactor float64    `toml:"backoff_jitter_factor"`
	PullPolicy          PullPolicy `toml:"pull_policy"`
}

RegistryConfig defines the configuration for the Docker registry.

type RuntimeConfig

type RuntimeConfig struct {
	Docker     DockerConfig     `toml:"docker"`
	Kubernetes KubernetesConfig `toml:"kubernetes"`
}

RuntimeConfig defines the configuration for the check runtimes.

type SQSReader

type SQSReader struct {
	Endpoint          string `toml:"endpoint"`
	ARN               string `toml:"arn"`
	VisibilityTimeout int    `toml:"visibility_timeout"`
	PollingInterval   int    `toml:"polling_interval"`
	ProcessQuantum    int    `toml:"process_quantum"`
}

SQSReader defines the config of sqs reader.

type SQSWriter

type SQSWriter struct {
	Endpoint string `toml:"endpoint"`
	ARN      string `toml:"arn"`
}

SQSWriter defines the config params from the sqs writer.

type StreamConfig

type StreamConfig struct {
	Endpoint      string `toml:"endpoint"` // Can be empty if no cancelation mechanism is required
	QueryEndpoint string `toml:"query_endpoint"`
	Timeout       int    `toml:"timeout"`
	Retries       int    `toml:"retries"`
	RetryInterval int    `toml:"retry_interval"`
}

StreamConfig defines the configuration for the event stream.

type UploaderConfig

type UploaderConfig struct {
	Endpoint      string `toml:"endpoint"`
	Timeout       int    `toml:"timeout"`
	Retries       int    `toml:"retries"`
	RetryInterval int    `toml:"retry_interval"`
}

UploaderConfig defines the configuration for the results service.

Jump to

Keyboard shortcuts

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