recorder implementations
This commit is contained in:
25
pkg/ambient/config/config_recorder.go
Normal file
25
pkg/ambient/config/config_recorder.go
Normal file
@ -0,0 +1,25 @@
|
||||
package config
|
||||
|
||||
type RecorderType string
|
||||
|
||||
const (
|
||||
TypeMemory RecorderType = "memory" // Stores weather updates in memory
|
||||
TypeRedis RecorderType = "redis" // Required for replicas > 1
|
||||
TypeNoop RecorderType = "noop" // No-op implementation
|
||||
)
|
||||
|
||||
type RecorderConfig struct {
|
||||
Type RecorderType `yaml:"type" env:"RECORDER_TYPE"` // memory|redis
|
||||
KeepLast int `yaml:"keepLast" env:"RECORDER_KEEP_LAST"`
|
||||
RedisConfig *RedisConfig
|
||||
}
|
||||
|
||||
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"`
|
||||
}
|
Reference in New Issue
Block a user