github.com/wfusion/gofusion@v1.1.14/redis/types.go (about) 1 package redis 2 3 import ( 4 "reflect" 5 6 "github.com/wfusion/gofusion/common/infra/drivers/redis" 7 "github.com/wfusion/gofusion/common/utils" 8 "github.com/wfusion/gofusion/log" 9 ) 10 11 const ( 12 ErrDuplicatedName utils.Error = "duplicated redis name" 13 ) 14 15 var ( 16 customLoggerType = reflect.TypeOf((*customLogger)(nil)).Elem() 17 ) 18 19 // Conf 20 //nolint: revive // struct tag too long issue 21 type Conf struct { 22 redis.Option `yaml:",inline" json:",inline" toml:",inline"` 23 Hooks []string `yaml:"hooks" json:"hooks" toml:"hooks" default:"[github.com/wfusion/gofusion/log/customlogger.redisLogger]"` 24 EnableLogger bool `yaml:"enable_logger" json:"enable_logger" toml:"enable_logger"` 25 LogInstance string `yaml:"log_instance" json:"log_instance" toml:"log_instance" default:"default"` 26 UnloggableCommands []string `yaml:"unloggable_commands" json:"unloggable_commands" toml:"unloggable_commands" default:"[echo,ping]"` 27 } 28 29 type customLogger interface { 30 Init(log log.Loggable, appName, name string) 31 }