Documentation
¶
Index ¶
- Variables
- func DefaultNewClient1(c *ClientConfig, cc *Config) (clt *redis.Client, err error)
- type Client
- type ClientConfig
- type Component
- type Config
- type Logger
- func (l *Logger) AfterProcess(ctx context.Context, cmd redis.Cmder) error
- func (l *Logger) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
- func (l *Logger) BeforeProcess(ctx context.Context, _ redis.Cmder) (context.Context, error)
- func (l *Logger) BeforeProcessPipeline(ctx context.Context, _ []redis.Cmder) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateClient = DefaultNewClient1
Functions ¶
func DefaultNewClient1 ¶
func DefaultNewClient1(c *ClientConfig, cc *Config) (clt *redis.Client, err error)
Types ¶
type Client ¶
type Client struct {
Client *redis.Client
Cfg ClientConfig
// contains filtered or unexported fields
}
type ClientConfig ¶
type Config ¶
type Config struct {
MaxReadTime int `json:"max_sock_read_time" yaml:"max_sock_read_time"`
MaxWriteTime int `json:"max_sock_write_time" yaml:"max_sock_write_time"`
MaxRequestTime int `json:"max_request_time" yaml:"max_request_time"`
IdleCheckTime int `json:"idle_check_time" yaml:"idle_check_time"`
SlowThreshold int `json:"slow_threshold" yaml:"slow_threshold"`
}
type Logger ¶ added in v0.1.2
Logger 实现 redis.Hook 接口,用于记录 Redis 命令日志
func (*Logger) AfterProcess ¶ added in v0.1.2
AfterProcess 在命令执行完成后调用
func (*Logger) AfterProcessPipeline ¶ added in v0.1.2
AfterProcessPipeline 在收到流水线响应后调用
func (*Logger) BeforeProcess ¶ added in v0.1.2
BeforeProcess 在命令发送到 Redis 服务器前调用
Click to show internal directories.
Click to hide internal directories.