support json schema
This commit is contained in:
@ -9,17 +9,17 @@ const (
|
||||
)
|
||||
|
||||
type RecorderConfig struct {
|
||||
Type RecorderType `yaml:"type" env:"RECORDER_TYPE"` // memory|redis
|
||||
KeepLast int `yaml:"keepLast" env:"RECORDER_KEEP_LAST"`
|
||||
RedisConfig *RedisConfig
|
||||
Type RecorderType `yaml:"type" env:"RECORDER_TYPE" json:"type,omitempty"` // memory|redis
|
||||
KeepLast int `yaml:"keepLast" env:"RECORDER_KEEP_LAST" json:"keepLast,omitempty"`
|
||||
RedisConfig *RedisConfig `json:"redisConfig,omitempty"`
|
||||
}
|
||||
|
||||
type RedisConfig struct {
|
||||
RedisHost string `yaml:"redisHost" env:"REDIS_HOST" default:"127.0.0.1"`
|
||||
RedisPort int `yaml:"redisPort" env:"REDIS_PORT" default:"6379"`
|
||||
RedisUser string `yaml:"redisUser" env:"REDIS_USER"`
|
||||
RedisPassword string `yaml:"redisPassword" env:"REDIS_PASSWORD"`
|
||||
RedisDB int `yaml:"redisDB" env:"REDIS_DB" default:"0"`
|
||||
RedisTLS bool `yaml:"redisTLS" env:"REDIS_TLS" default:"false"`
|
||||
RedisTLSInsecure bool `yaml:"redisTLSInsecure" env:"REDIS_TLS_INSECURE" default:"false"`
|
||||
RedisHost string `yaml:"redisHost" env:"REDIS_HOST" default:"127.0.0.1" json:"redisHost,omitempty"`
|
||||
RedisPort int `yaml:"redisPort" env:"REDIS_PORT" default:"6379" json:"redisPort,omitempty"`
|
||||
RedisUser string `yaml:"redisUser" env:"REDIS_USER" json:"redisUser,omitempty"`
|
||||
RedisPassword string `yaml:"redisPassword" env:"REDIS_PASSWORD" json:"redisPassword,omitempty"`
|
||||
RedisDB int `yaml:"redisDB" env:"REDIS_DB" default:"0" json:"redisDB,omitempty"`
|
||||
RedisTLS bool `yaml:"redisTLS" env:"REDIS_TLS" default:"false" json:"redisTLS,omitempty"`
|
||||
RedisTLSInsecure bool `yaml:"redisTLSInsecure" env:"REDIS_TLS_INSECURE" default:"false" json:"redisTLSInsecure,omitempty"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user