config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckPlugin

type CheckPlugin struct {
	Name    string
	Command cmdutil.Command
	User    string
	Env     Env
	Timeout time.Duration
	Memo    string
}

CheckPlugin represents check plugin

type Config

type Config struct {
	Apibase           string        `yaml:"apibase"`
	Apikey            string        `yaml:"apikey"`
	Root              string        `yaml:"root"`
	Roles             []string      `yaml:"roles"`
	IgnoreContainer   Regexpwrapper `yaml:"ignoreContainer"`
	ReadinessProbe    *Probe        `yaml:"readinessProbe"`
	HostStatusOnStart HostStatus    `yaml:"hostStatusOnStart"`
	MetricPlugins     []*MetricPlugin
	CheckPlugins      []*CheckPlugin
}

Config represents agent configuration

func Load

func Load(location string) (*Config, error)

Load loads agent configuration

type Env

type Env []string

Env represents environment variables

func (*Env) UnmarshalYAML

func (env *Env) UnmarshalYAML(unmarshal func(v interface{}) error) (err error)

UnmarshalYAML defines unmarshaler from YAML

type Header struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

Header is a request header for http probe.

type HostStatus

type HostStatus string

HostStatus represents host status

func (*HostStatus) UnmarshalText

func (s *HostStatus) UnmarshalText(text []byte) error

UnmarshalText decodes host status string

type MetricPlugin

type MetricPlugin struct {
	Name    string
	Command cmdutil.Command
	User    string
	Env     Env
	Timeout time.Duration
}

MetricPlugin represents metric plugin

type Probe

type Probe struct {
	Exec                *ProbeExec `yaml:"exec"`
	HTTP                *ProbeHTTP `yaml:"http"`
	TCP                 *ProbeTCP  `yaml:"tcp"`
	InitialDelaySeconds int        `yaml:"initialDelaySeconds"`
	PeriodSeconds       int        `yaml:"periodSeconds"`
	TimeoutSeconds      int        `yaml:"timeoutSeconds"`
}

Probe configuration.

type ProbeExec

type ProbeExec struct {
	Command cmdutil.Command `yaml:"command"`
	User    string          `yaml:"user"`
	Env     Env             `yaml:"env"`
}

ProbeExec is a probe with command.

type ProbeHTTP

type ProbeHTTP struct {
	Scheme    string   `yaml:"scheme"`
	Method    string   `yaml:"method"`
	Host      string   `yaml:"host"`
	Port      string   `yaml:"port"`
	Path      string   `yaml:"path"`
	Headers   []Header `yaml:"headers"`
	UserAgent string
}

ProbeHTTP is a probe with http.

type ProbeTCP

type ProbeTCP struct {
	Host string `yaml:"host"`
	Port string `yaml:"port"`
}

ProbeTCP is a probe with tcp.

type Regexpwrapper

type Regexpwrapper struct {
	*regexp.Regexp
}

Regexpwrapper wraps regexp.Regexp

func (*Regexpwrapper) UnmarshalText

func (r *Regexpwrapper) UnmarshalText(text []byte) error

UnmarshalText decodes regexp string

Jump to

Keyboard shortcuts

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