config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account added in v0.6.0

type Account struct {
	DirectTLS          bool             `yaml:"directtls,omitempty"`
	TLSConfig          config.TLSConfig `yaml:"tls_config,omitempty"`
	Address            string           `yaml:"client_address,omitempty"`
	Password           string           `yaml:"client_password,omitempty"`
	HealthCheckTimeout time.Duration    `yaml:"health_check_timeout,omitempty"`
}

func (*Account) Validate added in v0.6.0

func (a *Account) Validate() error

type AddressFamily added in v0.6.0

type AddressFamily string
const (
	ADDRESS_FAMILY_IPV4 AddressFamily = "ipv4"
	ADDRESS_FAMILY_IPV6 AddressFamily = "ipv6"
)

func (AddressFamily) MatchesNetwork added in v0.6.0

func (af AddressFamily) MatchesNetwork(network string) bool

func (AddressFamily) Network added in v0.6.0

func (af AddressFamily) Network(protocol string) string

func (AddressFamily) Validate added in v0.6.0

func (af AddressFamily) Validate() error

type C2SProbe

type C2SProbe struct {
	DirectTLS             bool             `yaml:"directtls,omitempty"`
	TLSConfig             config.TLSConfig `yaml:"tls_config,omitempty"`
	RequireSASLMechanisms []string         `yaml:"fail_if_sasl_mechanism_not_offered,omitempty"`
	ForbidSASLMechanisms  []string         `yaml:"fail_if_sasl_mechanism_offered,omitempty"`
	ExportSASLMechanisms  bool             `yaml:"export_sasl_mechanisms,omitempty"`
	RestrictAddressFamily AddressFamily    `yaml:"restrict_ip_version,omitempty"`
}

func (*C2SProbe) UnmarshalYAML

func (s *C2SProbe) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*C2SProbe) Validate

func (p *C2SProbe) Validate() error

type Config

type Config struct {
	Modules  map[string]Module  `yaml:"modules"`
	Accounts map[string]Account `yaml:"accounts"`
}

func LoadConfig added in v0.6.0

func LoadConfig(confFile string) (c *Config, err error)

func (*Config) UnmarshalYAML

func (s *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*Config) Validate

func (c *Config) Validate() error

type IBRProbe

type IBRProbe struct {
	Prefix                string           `yaml:"prefix,omitempty"`
	TLSConfig             config.TLSConfig `yaml:"tls_config,omitempty"`
	DirectTLS             bool             `yaml:"directtls,omitempty"`
	ExportErrorInfo       bool             `yaml:"export_error_info,omitempty"`
	RestrictAddressFamily AddressFamily    `yaml:"restrict_ip_version,omitempty"`
}

func (*IBRProbe) Validate

func (p *IBRProbe) Validate() error

type Module

type Module struct {
	Prober  string        `yaml:"prober,omitempty"`
	Timeout time.Duration `yaml:"timeout,omitempty"`
	C2S     C2SProbe      `yaml:"c2s,omitempty"`
	S2S     S2SProbe      `yaml:"s2s,omitempty"`
	Ping    PingProbe     `yaml:"ping,omitempty"`
	IBR     IBRProbe      `yaml:"ibr,omitempty"`
}

func (*Module) UnmarshalYAML

func (s *Module) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*Module) Validate

func (m *Module) Validate(validAccounts map[string]bool) error

type PingProbe

type PingProbe struct {
	Account            string        `yaml:"account,omitempty"`
	NoSharedConnection bool          `yaml:"no_shared_connection,omitempty"`
	PingTimeout        time.Duration `yaml:"ping_timeout,omitempty"`
	ExpectedResults    []PingResult  `yaml:"fail_if_not,omitempty"`
}

func (*PingProbe) UnmarshalYAML

func (s *PingProbe) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*PingProbe) Validate

func (p *PingProbe) Validate(validAccounts map[string]bool) error

type PingResult

type PingResult struct {
	Success        bool   `yaml:"success,omitempty"`
	ErrorType      string `yaml:"error_type,omitempty"`
	ErrorCondition string `yaml:"error_condition,omitempty"`
}

func (PingResult) Matches

func (r PingResult) Matches(other PingResult) bool

type S2SProbe

type S2SProbe struct {
	DirectTLS             bool             `yaml:"directtls,omitempty"`
	TLSConfig             config.TLSConfig `yaml:"tls_config,omitempty"`
	RequireSASLMechanisms []string         `yaml:"fail_if_sasl_mechanism_not_offered,omitempty"`
	ForbidSASLMechanisms  []string         `yaml:"fail_if_sasl_mechanism_offered,omitempty"`
	RequireDialback       bool             `yaml:"fail_if_dialback_not_offered,omitempty"`
	ForbidDialback        bool             `yaml:"fail_if_dialback_offered,omitempty"`
	ExportAuthMechanisms  bool             `yaml:"export_auth_mechanisms,omitempty"`
	From                  string           `yaml:"from"`
	RestrictAddressFamily AddressFamily    `yaml:"restrict_ip_version,omitempty"`
}

func (*S2SProbe) UnmarshalYAML

func (s *S2SProbe) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*S2SProbe) Validate

func (p *S2SProbe) Validate() error

type SafeConfig

type SafeConfig struct {
	sync.RWMutex

	C *Config
}

Jump to

Keyboard shortcuts

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