config

package module
v0.0.0-...-99d5ca6 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

View Source
const (
	DefaultClusterName = "default"
)

Variables

View Source
var (
	ErrNamespaceNotFound = errors.New("namespace not found")
)

Functions

This section is empty.

Types

type API

type API struct {
	Addr            string `yaml:"addr,omitempty" toml:"addr,omitempty" json:"addr,omitempty"`
	EnableBasicAuth bool   `yaml:"enable-basic-auth,omitempty" toml:"enable-basic-auth,omitempty" json:"enable-basic-auth,omitempty"`
	User            string `yaml:"user,omitempty" toml:"user,omitempty" json:"user,omitempty"`
	Password        string `yaml:"password,omitempty" toml:"password,omitempty" json:"password,omitempty"`
}

type Advance

type Advance struct {
	PeerPort             string `yaml:"peer-port,omitempty" toml:"peer-port,omitempty" json:"peer-port,omitempty"`
	IgnoreWrongNamespace bool   `yaml:"ignore-wrong-namespace,omitempty" toml:"ignore-wrong-namespace,omitempty" json:"ignore-wrong-namespace,omitempty"`
	WatchInterval        string `yaml:"watch-interval,omitempty" toml:"watch-interval,omitempty" json:"watch-interval,omitempty"`
}

type BackendNamespace

type BackendNamespace struct {
	Instances    []string `yaml:"instances" json:"instances" toml:"instances"`
	SelectorType string   `yaml:"selector-type" json:"selector-type" toml:"selector-type"`
	Security     TLSCert  `yaml:"security" json:"security" toml:"security"`
}

type Config

type Config struct {
	Workdir  string      `yaml:"workdir,omitempty" toml:"workdir,omitempty" json:"workdir,omitempty"`
	Proxy    ProxyServer `yaml:"proxy,omitempty" toml:"proxy,omitempty" json:"proxy,omitempty"`
	API      API         `yaml:"api,omitempty" toml:"api,omitempty" json:"api,omitempty"`
	Metrics  Metrics     `yaml:"metrics,omitempty" toml:"metrics,omitempty" json:"metrics,omitempty"`
	Log      Log         `yaml:"log,omitempty" toml:"log,omitempty" json:"log,omitempty"`
	Security Security    `yaml:"security,omitempty" toml:"security,omitempty" json:"security,omitempty"`
	Advance  Advance     `yaml:"advance,omitempty" toml:"advance,omitempty" json:"advance,omitempty"`
}

func NewConfig

func NewConfig(data []byte) (*Config, error)

func (*Config) Check

func (cfg *Config) Check() error

func (*Config) ToBytes

func (cfg *Config) ToBytes() ([]byte, error)

type FrontendNamespace

type FrontendNamespace struct {
	Security TLSCert `yaml:"security" json:"security" toml:"security"`
}

type Log

type Log struct {
	Level   string  `yaml:"level,omitempty" toml:"level,omitempty" json:"level,omitempty"`
	Encoder string  `yaml:"encoder,omitempty" toml:"encoder,omitempty" json:"encoder,omitempty"`
	LogFile LogFile `yaml:"log-file,omitempty" toml:"log-file,omitempty" json:"log-file,omitempty"`
}

type LogFile

type LogFile struct {
	Filename   string `yaml:"filename,omitempty" toml:"filename,omitempty" json:"filename,omitempty"`
	MaxSize    int    `yaml:"max-size,omitempty" toml:"max-size,omitempty" json:"max-size,omitempty"`
	MaxDays    int    `yaml:"max-days,omitempty" toml:"max-days,omitempty" json:"max-days,omitempty"`
	MaxBackups int    `yaml:"max-backups,omitempty" toml:"max-backups,omitempty" json:"max-backups,omitempty"`
}

type Metrics

type Metrics struct {
	PromCluster string `yaml:"prom-cluster,omitempty" toml:"prom-cluster,omitempty" json:"prom-cluster,omitempty"`
}

type Namespace

type Namespace struct {
	Namespace string            `yaml:"namespace" json:"namespace" toml:"namespace"`
	Frontend  FrontendNamespace `yaml:"frontend" json:"frontend" toml:"frontend"`
	Backend   BackendNamespace  `yaml:"backend" json:"backend" toml:"backend"`
}

type NamespaceDir

type NamespaceDir struct {
	// contains filtered or unexported fields
}

NamespaceDir is used by weirctl to import namespaces from a directory.

func NewNamespacesFromDir

func NewNamespacesFromDir(nsdir string) (*NamespaceDir, error)

func (*NamespaceDir) GetNamespace

func (f *NamespaceDir) GetNamespace(ns string) (*Namespace, error)

func (*NamespaceDir) ListAllNamespace

func (f *NamespaceDir) ListAllNamespace() ([]*Namespace, error)

type ProxyServer

type ProxyServer struct {
	ProxyServerOnline
	Addr          string `yaml:"addr,omitempty" toml:"addr,omitempty" json:"addr,omitempty"`
	PDAddrs       string `yaml:"pd-addrs,omitempty" toml:"pd-addrs,omitempty" json:"pd-addrs,omitempty"`
	ProxyProtocol string `yaml:"proxy-protocol,omitempty" toml:"proxy-protocol,omitempty" json:"proxy-protocol,omitempty"`
}

type ProxyServerOnline

type ProxyServerOnline struct {
	MaxConnections uint64 `yaml:"max-connections,omitempty" toml:"max-connections,omitempty" json:"max-connections,omitempty"`
	TCPKeepAlive   bool   `yaml:"tcp-keep-alive,omitempty" toml:"tcp-keep-alive,omitempty" json:"tcp-keep-alive,omitempty"`
}

type Security

type Security struct {
	RSAKeySize int     `yaml:"rsa-key-size,omitempty" toml:"rsa-key-size,omitempty" json:"rsa-key-size,omitempty"`
	Server     TLSCert `yaml:"server,omitempty" toml:"server,omitempty" json:"server,omitempty"`
	Cluster    TLSCert `yaml:"cluster,omitempty" toml:"cluster,omitempty" json:"cluster,omitempty"`
}

type TLSCert

type TLSCert struct {
	CA   string `yaml:"ca,omitempty" toml:"ca,omitempty" json:"ca,omitempty"`
	Cert string `yaml:"cert,omitempty" toml:"cert,omitempty" json:"cert,omitempty"`
	Key  string `yaml:"key,omitempty" toml:"key,omitempty" json:"key,omitempty"`
}

func (TLSCert) HasCA

func (c TLSCert) HasCA() bool

func (TLSCert) HasCert

func (c TLSCert) HasCert() bool

Jump to

Keyboard shortcuts

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