config

package
v0.0.0-...-8ec60ba Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasDuplicateTargets

func HasDuplicateTargets(m Targets) (bool, error)

HasDuplicateTargets Find duplicates with same type

Types

type Conf

type Conf struct {
	Refresh           duration `yaml:"refresh" json:"refresh" default:"0s"`
	Nameserver        string   `yaml:"nameserver" json:"nameserver"`
	NameserverTimeout duration `yaml:"nameserver_timeout" json:"nameserver_timeout" default:"250ms"`
}

type Config

type Config struct {
	Conf    `yaml:"conf" json:"conf"`
	ICMP    `yaml:"icmp" json:"icmp"`
	MTR     `yaml:"mtr" json:"mtr"`
	TCP     `yaml:"tcp" json:"tcp"`
	HTTPGet `yaml:"http_get" json:"http_get"`
	Targets `yaml:"targets" json:"targets"`
}

type HTTPGet

type HTTPGet struct {
	Interval duration `yaml:"interval" json:"interval" default:"15s"`
	Timeout  duration `yaml:"timeout" json:"timeout" default:"14s"`
}

type ICMP

type ICMP struct {
	Interval duration `yaml:"interval" json:"interval" default:"5s"`
	Timeout  duration `yaml:"timeout" json:"timeout" default:"4s"`
	Count    int      `yaml:"count" json:"count" default:"10"`
}

type MTR

type MTR struct {
	Interval duration `yaml:"interval" json:"interval" default:"5s"`
	Timeout  duration `yaml:"timeout" json:"timeout" default:"4s"`
	MaxHops  int      `yaml:"max-hops" json:"max-hops" default:"30"`
	Count    int      `yaml:"count" json:"count" default:"10"`
}

type Resolver

type Resolver struct {
	Resolver *net.Resolver
	Timeout  time.Duration
}

SafeConfig Safe configuration reload

type SafeConfig

type SafeConfig struct {
	Cfg *Config
	sync.RWMutex
}

SafeConfig Safe configuration reload

func (*SafeConfig) ReloadConfig

func (sc *SafeConfig) ReloadConfig(logger log.Logger, confFile string) (err error)

ReloadConfig Safe configuration reload

type TCP

type TCP struct {
	Interval duration `yaml:"interval" json:"interval" default:"5s"`
	Timeout  duration `yaml:"timeout" json:"timeout" default:"4s"`
}

type Targets

type Targets []struct {
	Name     string   `yaml:"name" json:"name"`
	Host     string   `yaml:"host" json:"host"`
	Type     string   `yaml:"type" json:"type"`
	Proxy    string   `yaml:"proxy" json:"proxy"`
	Probe    []string `yaml:"probe" json:"probe"`
	SourceIp string   `yaml:"source_ip" json:"source_ip"`
	Labels   extraKV  `yaml:"labels,omitempty" json:"labels,omitempty"`
}

Jump to

Keyboard shortcuts

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