config

package
v0.0.0-...-4c5efe1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RaftDir      = "raft"
	RaftListen   = ":7001"
	RaftLogLevel = "off"

	EtcdLogLevel = "error"
	EtcdPrefix   = "/haproxy-lb"

	HAProxyService    = "haproxy"
	HAProxyConfigFile = "/etc/haproxy/haproxy.cfg"
)

Variables

This section is empty.

Functions

func LoadCertPool

func LoadCertPool(file string) (p *x509.CertPool, err error)

func Validate

func Validate(c *Config) error

Types

type APIServer

type APIServer struct {
	Listen      string      `yaml:"listen"`
	TLS         *TLS        `yaml:"tls"`
	DisableAuth bool        `yaml:"disableAuth"`
	BasicAuth   []BasicAuth `yaml:"basicAuth"`
}

type BasicAuth

type BasicAuth struct {
	User   string `yaml:"user"`
	Hash   string `yaml:"hash"`
	Prefix string `yaml:"prefix"`
}

type Cluster

type Cluster struct {
	Raft *Raft `yaml:"raft,omitempty"`
	Etcd *Etcd `yaml:"etcd,omitempty"`
}

type Config

type Config struct {
	LeaderHook     string    `yaml:"leaderHook,omitempty"`
	FollowerHook   string    `yaml:"followerHook,omitempty"`
	HAProxyConfig  string    `yaml:"haproxyConfig,omitempty"`
	HAProxyService string    `yaml:"haproxyService,omitempty"`
	Failover       *Failover `yaml:"failover"`
	VIP            VIP       `yaml:"vip"`
	Cluster        Cluster   `yaml:"cluster"`
	APIServer      APIServer `yaml:"apiServer"`
}

func ParseFile

func ParseFile(file string) (cfg *Config, err error)

type Etcd

type Etcd struct {
	Endpoints   []string `yaml:"endpoints"`
	ClusterName string   `yaml:"clusterName"`
	Prefix      string   `yaml:"prefix,omitempty"`
	Username    string   `yaml:"username,omitempty"`
	Password    string   `yaml:"password,omitempty"`
	TLS         *TLS     `yaml:"tls,omitempty"`
	LogLevel    string   `yaml:"logLevel,omitempty"`
}

type Failover

type Failover struct {
	IP        string `yaml:"ip"`
	Interface string `yaml:"interface"`
}

type Netbox

type Netbox struct {
	Endpoint string `yaml:"endpoint"`
	Token    string `yaml:"token"`
	Insecure bool   `yaml:"insecure,omitempty"`
}

type Raft

type Raft struct {
	Dir      string     `yaml:"dir,omitempty"`
	ID       string     `yaml:"id"`
	Listen   string     `yaml:"listen"`
	Peers    []RaftPeer `yaml:"peers"`
	TLS      *TLS       `yaml:"tls,omitempty"`
	LogLevel string     `yaml:"logLevel,omitempty"`
}

type RaftPeer

type RaftPeer struct {
	ID      string `yaml:"id"`
	Address string `yaml:"address"`
}

RaftPeer details the configuration of all cluster peers

type Store

type Store struct {
	Local  *struct{} `yaml:"local"`
	Netbox *Netbox   `yaml:"netbox"`
}

type TLS

type TLS struct {
	Cert     string `yaml:"cert,omitempty"`
	Key      string `yaml:"key,omitempty"`
	CA       string `yaml:"ca,omitempty"`
	Insecure bool   `yaml:"insecure,omitempty"`
}

type VIP

type VIP struct {
	Prefix    string `yaml:"prefix"`
	Store     Store  `yaml:"store"`
	Interface string `yaml:"interface,omitempty"`
	Label     string `yaml:"label,omitempty"`
}

Jump to

Keyboard shortcuts

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