Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSuchRedisDB = fmt.Errorf("no such redis db")
View Source
var ErrNoSuchRpcServer = fmt.Errorf("no such http Rpc Server")
View Source
var ServiceBatchSize int64 = 64
ServiceBatchSize is the number of tasks that a service can read from redis at the same time
Functions ¶
func GetConfigFilePath ¶
func GetRdsClientByName ¶
func LoadConfig_FromWeb ¶
func LoadConfig_FromWeb()
Types ¶
type ApiSourceHttp ¶
the http rpc server
func GetHttpServerByName ¶
func GetHttpServerByName(name string) (server *ApiSourceHttp, err error)
type ConfigHttp ¶
type ConfigHttp struct { CORES string Port int64 `env:"Port,default=80"` Path string `env:"Path,default=/"` //MaxBufferSize is the max size of a task in bytes, default 10M MaxBufferSize int64 `env:"MaxBufferSize,default=10485760"` JwtSecret string `env:"Secret"` //AutoAuth should never be true in production AutoAuth bool `env:"AutoAuth,default=false"` }
type ConfigRedis ¶
type ConfigSettings ¶
type ConfigSettings struct { //{"DebugLevel": 0,"InfoLevel": 1,"WarnLevel": 2,"ErrorLevel": 3,"FatalLevel": 4,"PanicLevel": 5,"NoLevel": 6,"Disabled": 7 } LogLevel int8 //super user token, this is used to bypass the security check //SUToken is designed to allow debugging in production environment without change the permission table permanently SUToken string }
type Configuration ¶
type Configuration struct { ConfigUrl string Http ConfigHttp //redis server, format: username:password@address:port/db Redis []*ConfigRedis HttpRPC []*ApiSourceHttp Settings ConfigSettings }
var Cfg Configuration = Configuration{ ConfigUrl: "", Redis: []*ConfigRedis{}, Http: ConfigHttp{CORES: "*", Port: 80, Path: "/", MaxBufferSize: 10485760}, HttpRPC: []*ApiSourceHttp{{Name: "doptime", UrlBase: "https://api.doptime.com", Jwt: ""}}, Settings: ConfigSettings{LogLevel: 1}, }
set default values
func (Configuration) String ¶
func (c Configuration) String() string
Click to show internal directories.
Click to hide internal directories.