redis

package
v1.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

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

type RedisLogger struct {
	*zapLogger.ZapLogger
	// contains filtered or unexported fields
}

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

func (rl *RedisLogger) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)

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

func (*RedisLogger) Error

func (rl *RedisLogger) Error(ctx context.Context, isPipeline bool, cmds []redis.Cmder, cost int64)

func (*RedisLogger) Info

func (rl *RedisLogger) Info(ctx context.Context, isPipeline bool, cmds []redis.Cmder, cost int64)

type RedisOption

type RedisOption func(rl *RedisLogger)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL