common

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(message string) error

Error creates an error, and logs it righteously

func ErrorE

func ErrorE(message string, err error) error

Encapsulate err in a structured log and return an abstracted high-level error with message as the payload

func ErrorEF

func ErrorEF(message string, err error, fields log.Fields) error

Encapsulate fields and err in a structured log and return an abstracted high-level error with message as the payload

func ErrorF

func ErrorF(message string, fields log.Fields) error

Encapsulate fields in a structured log and return an abstracted high-level error with message as the payload

func EtcdClient

func EtcdClient() (*clientv3.Client, error)

func InitLogging

func InitLogging(logname string)

func LoadConfig

func LoadConfig()

Types

type Config

type Config struct {
	Driver    ServiceConfig
	Etcd      ServiceConfig
	Elastic   ServiceConfig
	Commander ServiceConfig
	Beluga    ServiceConfig
	Nex       ServiceConfig
	Tuning    Tuning
	Net       NetConfig
}

func GetConfig

func GetConfig() Config

type NetConfig

type NetConfig struct {
	VtepIfx         string `yaml:"vtepIfx"`
	Mtu             int    `yaml:"mtu"`
	VtepMtu         int    `yaml:"vtepMtu"`
	ServiceTunnelIP string `yaml:"serviceTunnelIP"`

	ExternalIfx     string `yaml:"externalIfx"`
	ExternalIP      string `yaml:"externalIP"`
	ExternalSubnet  string `yaml:"externalSubnet"`
	ExternalGateway string `yaml:"externalGateway"`
}

type ServiceConfig

type ServiceConfig struct {
	Address string
	Port    int
	Tls     *TlsConfig
}

func (*ServiceConfig) Endpoint

func (s *ServiceConfig) Endpoint() string

type TlsConfig

type TlsConfig struct {
	Cacert string
	Cert   string
	Key    string
}

type Tuning

type Tuning struct {
	TaskQuantum int `yaml:"taskQuantum"`
	TaskLease   int `yaml:"taskLease"`
	FailSleep   int `yaml:"failSleep"`
}

Jump to

Keyboard shortcuts

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