config

package
v0.0.0-...-c52e41a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key string) interface{}

func GetBool

func GetBool(key string) bool

func GetConnectionTTL

func GetConnectionTTL() int

func GetCredentials

func GetCredentials(role string) common.Credentials

func GetDefaultBackend

func GetDefaultBackend() string

func GetForceRouting

func GetForceRouting() bool

func GetHealthCheckConfig

func GetHealthCheckConfig() common.HealthCheckConfig

func GetInt

func GetInt(key string) int

func GetNodes

func GetNodes() map[string]common.Node

func GetPickSessionLevel

func GetPickSessionLevel() string

func GetPoolCapacity

func GetPoolCapacity() int

func GetPoolEnable

func GetPoolEnable() bool

func GetQueryRoutes

func GetQueryRoutes() map[string]common.QueryRoute

func GetString

func GetString(key string) string

func GetStringMap

func GetStringMap(key string) map[string]interface{}

func GetStringMapString

func GetStringMapString(key string) map[string]string

func GetStringSlice

func GetStringSlice(key string) []string

func HasClient

func HasClient(userName string, authMethod int32) bool

func IsSet

func IsSet(key string) bool

func ReadConfig

func ReadConfig()

func Set

func Set(key string, value interface{})

func SetConfigPath

func SetConfigPath(path string)

Types

type Adapter

type Adapter struct {
	AdapterType string                 `mapstructure:"adaptertype"`
	Metadata    map[string]interface{} `mapstructure:"metadata"`
}

type AdminConfig

type AdminConfig struct {
	HostPort string `mapstructure:"hostport"`
}

func GetAdminConfig

func GetAdminConfig() AdminConfig

type Config

type Config struct {
	//Nodes       map[string]common.Node `mapstructure:"nodes"`
	Server           ServerConfig                  `mapstructure:"server"`
	Pool             PoolConfig                    `mapstructure:"pool"`
	Nodes            map[string]common.Node        `mapstructure:"nodes"`
	Credentials      map[string]common.Credentials `mapstructure:"credentials"`
	HealthCheck      common.HealthCheckConfig      `mapstructure:"healthcheck"`
	Routes           map[string]common.QueryRoute  `mapstructure:"routes"`
	Clients          string                        `mapstructure:"clients"`
	DefaultBackend   string                        `mapstructure:"default-backend"`
	PickSessionLevel string                        `mapstructure:"pick-session-level"`
	ConnectionTTL    int                           `mapstructure:"connection-ttl"`
}

func GetConfig

func GetConfig() Config

type PoolConfig

type PoolConfig struct {
	Capacity     int  `mapstructure:"capacity"`
	Enable       bool `mapstructure:"enable"`
	ForceRouting bool `mapstructure:"forceRouting"`
}

type ProxyConfig

type ProxyConfig struct {
	HostPort string `mapstructure:"hostport"`
}

func GetProxyConfig

func GetProxyConfig() ProxyConfig

type ServerConfig

type ServerConfig struct {
	Admin AdminConfig `mapstructure:"admin"`
	Proxy ProxyConfig `mapstructure:"proxy"`
}

Jump to

Keyboard shortcuts

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