Documentation ¶
Index ¶
- type RedisConfig
- type RedisLogger
- func (rl *RedisLogger) AfterProcess(ctx context.Context, cmd redis.Cmder) error
- func (rl *RedisLogger) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
- func (rl *RedisLogger) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)
- func (rl *RedisLogger) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)
- func (rl *RedisLogger) Error(ctx context.Context, isPipeline bool, cmds []redis.Cmder, cost int64)
- func (rl *RedisLogger) Info(ctx context.Context, isPipeline bool, cmds []redis.Cmder, cost int64)
- type RedisOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisConfig ¶
type RedisConfig struct { InfoFile string ErrorFile string Level string ServiceName string Host string Port int }
RedisConfig is used to parse configuration file logger should be controlled with Options
type RedisLogger ¶
RedisLogger is go-redis logger Hook
func NewRedisLogger ¶
func NewRedisLogger(config *RedisConfig, opts ...RedisOption) (rl *RedisLogger, err error)
NewRedisLogger
func (*RedisLogger) AfterProcess ¶
func (rl *RedisLogger) AfterProcess(ctx context.Context, cmd redis.Cmder) error
AfterProcess redis after execute action do something
func (*RedisLogger) AfterProcessPipeline ¶
func (rl *RedisLogger) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
AfterProcessPipeline after command process handle
func (*RedisLogger) BeforeProcess ¶
BeforeProcess redis before execute action do something
func (*RedisLogger) BeforeProcessPipeline ¶
func (rl *RedisLogger) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)
BeforeProcessPipeline before command process handle
type RedisOption ¶
type RedisOption func(rl *RedisLogger)
Click to show internal directories.
Click to hide internal directories.