support json schema
All checks were successful
Build and Publish / release (push) Has been skipped
Build and Publish / check-chart (push) Successful in 10s
Build and Publish / helm-release (push) Has been skipped

This commit is contained in:
2025-03-22 14:04:20 -04:00
parent b483fc22a3
commit 46a213f314
9 changed files with 366 additions and 85 deletions

View File

@ -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"`
}