config

package
v0.0.0-...-f44c4f3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 2 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 GetInt

func GetInt(key string) int

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 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 CommonConfig

type CommonConfig struct {
	PoolFreeInterval uint32 `mapstructure:"pool_free_interval"`
	Version          string `mapstructure:"version"`
	StaticPath       string `mapstructure:"staticPath"`
}

type Config

type Config struct {
	Serve    ServeConfig  `mapstructure:"serve"`
	DbServer DBConfig     `mapstructure:"postgresqlServer"`
	Common   CommonConfig `mapstructure:"common"`
}

func GetConfig

func GetConfig() Config

type DBConfig

type DBConfig struct {
	ReadHost  string `mapstructure:"readhost"`
	ReadPort  int    `mapstructure:"readport"`
	WriteHost string `mapstructure:"writehost"`
	WritePort int    `mapstructure:"writeport"`
	Username  string `mapstructure:"username"`
	Password  string `mapstructure:"password"`
	Database  string `mapstructure:"database"`
}

type SSLConfig

type SSLConfig struct {
	SSLMode string `mapstructure:"sslmode"`
	SSLCert string `mapstructure:"sslcert"`
	SSLKey  string `mapstructure:"sslkey"`
}

type ServeConfig

type ServeConfig struct {
	GrpcHostPort    string `mapstructure:"grpcHostPort"`
	RestfulHostPort string `mapstructure:"restfulHostPort"`
}

Jump to

Keyboard shortcuts

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