diff --git a/logger/config.go b/logger/config.go index bb8a8d08..1d1e7dee 100644 --- a/logger/config.go +++ b/logger/config.go @@ -17,8 +17,8 @@ package logger import "sync" type Config struct { - JSON bool `yaml:"json"` - Level string `yaml:"level"` + JSON bool `yaml:"json,omitempty"` + Level string `yaml:"level,omitempty"` // true to enable log sampling, where the same log message and level will be throttled. // we have two layers of sampling // 1. global sampling - within a second, it will log the first SampleInitial, then every SampleInterval messages. diff --git a/redis/redis.go b/redis/redis.go index 36ef627e..b5d613db 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -28,21 +28,21 @@ import ( var ErrNotConfigured = errors.New("Redis is not configured") type RedisConfig struct { - Address string `yaml:"address"` - Username string `yaml:"username"` - Password string `yaml:"password"` - DB int `yaml:"db"` - UseTLS bool `yaml:"use_tls"` - MasterName string `yaml:"sentinel_master_name"` - SentinelUsername string `yaml:"sentinel_username"` - SentinelPassword string `yaml:"sentinel_password"` - SentinelAddresses []string `yaml:"sentinel_addresses"` - ClusterAddresses []string `yaml:"cluster_addresses"` - DialTimeout int `yaml:"dial_timeout"` - ReadTimeout int `yaml:"read_timeout"` - WriteTimeout int `yaml:"write_timeout"` + Address string `yaml:"address,omitempty"` + Username string `yaml:"username,omitempty"` + Password string `yaml:"password,omitempty"` + DB int `yaml:"db,omitempty"` + UseTLS bool `yaml:"use_tls,omitempty"` + MasterName string `yaml:"sentinel_master_name,omitempty"` + SentinelUsername string `yaml:"sentinel_username,omitempty"` + SentinelPassword string `yaml:"sentinel_password,omitempty"` + SentinelAddresses []string `yaml:"sentinel_addresses,omitempty"` + ClusterAddresses []string `yaml:"cluster_addresses,omitempty"` + DialTimeout int `yaml:"dial_timeout,omitempty"` + ReadTimeout int `yaml:"read_timeout,omitempty"` + WriteTimeout int `yaml:"write_timeout,omitempty"` // for clustererd mode only, number of redirects to follow, defaults to 2 - MaxRedirects *int `yaml:"max_redirects"` + MaxRedirects *int `yaml:"max_redirects,omitempty"` } func (r *RedisConfig) IsConfigured() bool {