config

package
v0.0.0-...-f657c13 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcdAuthTypeNone     = "None"
	EtcdAuthTypePassowrd = "Password"
)
View Source
const (
	LogLevelWarn  = "warn"
	LogLevelInfo  = "info"
	LogLevelDebug = "debug"
	LogLevelTrace = "trace"

	LogFormatText = "text"
	LogFormatJson = "json"
)

Variables

This section is empty.

Functions

func InitGlobalConfig

func InitGlobalConfig(conf *GlobalConfig)

func PrintConfigTemplate

func PrintConfigTemplate(format string)

Types

type ControlPlaneAPIServerConfig

type ControlPlaneAPIServerConfig struct {
	ListenAddr  string   `json:"listenAddr" yaml:"listenAddr"`
	GinMode     string   `json:"ginMode" yaml:"ginMode"` // debug, release, test
	CorsOrigins []string `json:"corsOrigins" yaml:"corsOrigins"`
}

type DBConfig

type DBConfig struct {
	Host                 string            `json:"host" yaml:"host"`
	Port                 int               `json:"port" yaml:"port"`
	Database             string            `json:"database" yaml:"database"`
	ConnectionParameters map[string]string `json:"connectionParameters" yaml:"connectionParameters"`
	User                 string            `json:"user" yaml:"user"`
	Password             string            `json:"password" yaml:"password"`
	EngineType           string            `json:"engineType" yaml:"engineType"`         // mysql, postgres
	TargetDatabase       string            `json:"targetDatabase" yaml:"targetDatabase"` // dbname
	TablesPrefix         string            `json:"tablesPrefix" yaml:"tablesPrefix"`
	MaxPoolSize          int               `json:"maxPoolSize" yaml:"maxPoolSize"`
	MaxIdleSize          int               `json:"maxIdleSize" yaml:"maxIdleSize"`
}

type EtcdConfig

type EtcdConfig struct {
	Endpoints    []string `json:"endpoints" yaml:"endpoints"`
	AuthType     string   `json:"authType" yaml:"authType"`
	Username     string   `json:"username" yaml:"username"`
	Password     string   `json:"password" yaml:"password"`
	KeyNamespace string   `json:"keyNamespace" yaml:"keyNamespace"` // Auto prepend key prefix, like: gw-control/xds (without trailing slash, it will be added automatically)
}

type GlobalConfig

type GlobalConfig struct {
	ServerConfig    ControlPlaneAPIServerConfig `json:"serverConfig" yaml:"serverConfig"`
	LogConfig       LoggerConfig                `json:"logConfig" yaml:"logConfig"`
	DBConfig        DBConfig                    `json:"dbConfig" yaml:"dbConfig"`
	EtcdConfig      EtcdConfig                  `json:"etcdConfig" yaml:"etcdConfig"`
	XdsServerConfig XdsServerConfig             `json:"xdsServerConfig" yaml:"xdsServerConfig"`
}

func GetGlobalConfig

func GetGlobalConfig() GlobalConfig

GetProvisionerConfig returns a copy of global config object

type LoggerConfig

type LoggerConfig struct {
	Level     string `json:"level" yaml:"level"`
	LogFormat string `json:"logFormat" yaml:"logFormat"` // text, json
	Color     bool   `json:"color" yaml:"color"`         // console log color
	FileLog   struct {
		Enable     bool   `json:"enable" yaml:"enable"`
		LogFileDir string `json:"logFileDir" yaml:"logFileDir"`
	} `json:"fileLog" yaml:"fileLog"`
}

type XdsServerConfig

type XdsServerConfig struct {
	ListenAddr                  string `json:"listenAddr" yaml:"listenAddr"`
	GrpcKeepaliveSeconds        uint64 `json:"grpcKeepaliceSeconds" yaml:"grpcKepaliveSeconds"`
	GrpcKeepaliveTimeoutSeconds uint64 `json:"grpcKeepaliveTimeoutSeconds" yaml:"grpcKeepaliveTimeoutSeconds"`
	GrpcKeepaliveMinTimeSeconds uint64 `json:"grpcKeepaliveMinTimeSeoncds" yaml:"grpcKeepaliveMinTimeSeoncds"`
	GrpcMaxConcurrentStreams    uint64 `json:"grpcMaxConcurrentStreams" yaml:"grpcMaxConcurrentStreams"`
}

Jump to

Keyboard shortcuts

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