config

package
v0.0.0-...-22c38b1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2018 License: MIT Imports: 5 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LOG_LEVELS = []logutils.LogLevel{"DEBUG", "INFO", "WARN", "ERROR"}
)

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	Interface string

	Balancer string
	Name     string
	Address  string
	Port     uint16
	Weight   int32
	Mode     string
	Service  string
}

func (*AgentConfig) GetIpByInterface

func (c *AgentConfig) GetIpByInterface() (string, error)

type BalancerConfig

type BalancerConfig struct {
	Interfaces

	Name               string `mapstructure:"name" validate:"required"`
	LogLevel           string `mapstructure:"log-level"`
	ClusterMode        string `mapstructure:"cluster-mode"` //Defines if balancer is in UNICAST or ANYCAST
	EnableHealthChecks bool   `mapstructure:"enable-health-checks"`
	StorePrefix        string `mapstructure:"store-prefix"`
	Bgp
	Ipam
	Metrics

	// StoreAddress string `mapstructure:"store-address"`
	EtcdEndpoints string `mapstructure:"etcd-endpoints"`
}

func (*BalancerConfig) GetIpByInterface

func (c *BalancerConfig) GetIpByInterface() (string, error)

func (BalancerConfig) Validate

func (config BalancerConfig) Validate() error

type Bgp

type Bgp struct {
	As        uint32     `validate:"required"`
	RouterId  string     `validate:"ipv4,required" mapstructure:"router-id"`
	Neighbors []Neighbor `validate:"required,dive"`
}

func (Bgp) Validate

func (bgp Bgp) Validate() error

type Interfaces

type Interfaces struct {
	Inbound  string `validate:"required"`
	Outbound string `validate:"required"`
}

func (Interfaces) Validate

func (interfaces Interfaces) Validate() error

type Ipam

type Ipam struct {
	Ranges []string `validate:"dive,cidrv4"`
}

func (Ipam) Validate

func (ipam Ipam) Validate() error

type Metrics

type Metrics struct {
	Publisher string
	Interval  uint16
	Params    map[string]interface{}
	Extras    map[string]string
}

type Neighbor

type Neighbor struct {
	Address string `validate:"ipv4,required"`
	PeerAs  uint32 `validate:"required" mapstructure:"peer-as"`
}

type Validater

type Validater interface {
	Validate() error
}

Validater validates a config

Jump to

Keyboard shortcuts

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