Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Rds map[string]*redis.Client = map[string]*redis.Client{}
Functions ¶
func GetRdsClientByName ¶
func LoadConfig ¶
func LoadConfig() (err error)
Types ¶
type ConfigAPI ¶
type ConfigAPI struct { //ServiceBatchSize is the number of tasks that a service can read from redis at the same time ServiceBatchSize int64 `env:"ServiceBatchSize,default=64"` }
type ConfigData ¶
type ConfigData struct { //AutoAuth should never be true in production AutoAuth bool `env:"AutoAuth,default=false"` }
type ConfigHttp ¶
type ConfigRedis ¶
type Configuration ¶
type Configuration struct { //redis server, format: username:password@address:port/db Redis []*ConfigRedis Jwt ConfigJWT Http ConfigHttp Api ConfigAPI Data ConfigData //{"DebugLevel": 0,"InfoLevel": 1,"WarnLevel": 2,"ErrorLevel": 3,"FatalLevel": 4,"PanicLevel": 5,"NoLevel": 6,"Disabled": 7 } LogLevel int8 `env:"LogLevel,default=1"` }
var Cfg Configuration = Configuration{ Redis: []*ConfigRedis{}, Jwt: ConfigJWT{Secret: "", Fields: "*"}, Http: ConfigHttp{CORES: "*", Port: 80, Path: "/", Enable: false, MaxBufferSize: 10485760}, Api: ConfigAPI{ServiceBatchSize: 64}, Data: ConfigData{AutoAuth: false}, LogLevel: 1, }
set default values
Click to show internal directories.
Click to hide internal directories.