API configuration
rest.RestConf
service.ServiceConf // service configuration
Host string `json:",default=0.0.0.0"` // http listening ip, default 0.0.0.0
Port int // http listening port, required
CertFile string `json:",optional"` // https certificate file, optional
KeyFile string `json:",optional"` // https private key file, optional
Verbose bool `json:",optional"` // whether to print detailed http request log
MaxBytes int64 `json:",default=1048576,range=[0:8388608]"` // http can accept the maximum Content Length of the request, the default is 1048576, and the set value cannot be between 0 and 8388608
// milliseconds
Timeout int64 `json:",default=3000"` // timeout duration control, unit: milliseconds, default 3000
Signature SignatureConf `json:",optional"` // signature configuration
service.ServiceConf
type ServiceConf struct {
Name string // service name
Log logx.LogConf // log configuration
Mode string `json:",default=pro,options=dev|test|pre|pro"` // service environment, dev-development environment, test-test environment, pre-pre-release environment, pro-formal environment
MetricsUrl string `json:",optional"` // index report interface address, this address needs to support post json
Prometheus prometheus.Config `json:",optional"` // prometheus configuration
}
prometheus.Config
type Config struct {
Host string `json:",optional"` // prometheus monitor host
Port int `json:",default=9101"` // prometheus listening port
Path string `json:",default=/metrics"` // report address
SignatureConf
SignatureConf struct {
Expiry time.Duration `json:",default=1h"` // Validity period, default is 1 hour
PrivateKeys []PrivateKeyConf // Signing key related configuration
}
cache.CacheConf
ClusterConf []NodeConf
NodeConf struct {
redis.RedisConf
Weight int `json:",default=100"` // Weights
}
redis.RedisConf
RedisConf struct {
Host string // redis address
Type string `json:",default=node,options=node|cluster"` // redis type
Pass string `json:",optional"` // redis password
}