update
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Description : redis 客户端
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-02-27 4:49 下午
|
||||
package redis
|
||||
@ -20,7 +20,7 @@ import (
|
||||
|
||||
// defaultParseError ...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:59 下午 2021/2/27
|
||||
func defaultParseError(err error) error {
|
||||
@ -44,7 +44,7 @@ func defaultParseError(err error) error {
|
||||
|
||||
// Options 连接选项,百分之百兼容第三方包的选项
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 4:57 下午 2021/2/27
|
||||
type Options struct {
|
||||
@ -63,7 +63,7 @@ type RealClient struct {
|
||||
|
||||
// NewClient 获取redis client实例
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 5:05 下午 2021/2/27
|
||||
func NewClient(config map[string]Options, parseErrorFunc func(err error) error) (ClientInterface, error) {
|
||||
@ -80,7 +80,7 @@ func NewClient(config map[string]Options, parseErrorFunc func(err error) error)
|
||||
|
||||
// Client 包装的redis client
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 4:52 下午 2021/2/27
|
||||
type Client struct {
|
||||
@ -91,7 +91,7 @@ type Client struct {
|
||||
|
||||
// init 初始化redis连接
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 5:31 下午 2021/2/27
|
||||
func (c *Client) init() error {
|
||||
@ -135,7 +135,7 @@ func (c *Client) init() error {
|
||||
|
||||
// getLogger ...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 7:07 下午 2021/2/27
|
||||
func (c *Client) getLogger(conf *LoggerConfig) (*zap.Logger, error) {
|
||||
@ -152,7 +152,7 @@ func (c *Client) getLogger(conf *LoggerConfig) (*zap.Logger, error) {
|
||||
|
||||
// GetRedisClient 获取redis实例
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 5:16 下午 2021/2/27
|
||||
func (c *Client) GetRedisClient(flag string) (*RealClient, error) {
|
||||
@ -165,7 +165,7 @@ func (c *Client) GetRedisClient(flag string) (*RealClient, error) {
|
||||
|
||||
// log 记录redis请求日志
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 8:52 下午 2021/2/27
|
||||
func (c *Client) log(ctx *Context, realClient *RealClient, cmdResult redisInstance.Cmder, startTime int64, finishTime int64) {
|
||||
@ -183,7 +183,7 @@ func (c *Client) log(ctx *Context, realClient *RealClient, cmdResult redisInstan
|
||||
|
||||
// CommandProxy 执行命令的代理
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 9:41 下午 2021/2/27
|
||||
func (c *Client) CommandProxy(ctx *Context, flag string, cmd string, param ...interface{}) (interface{}, error) {
|
||||
@ -210,7 +210,7 @@ func (c *Client) CommandProxy(ctx *Context, flag string, cmd string, param ...in
|
||||
|
||||
// CommandProxyWithReceiver 执行命令,并解析结果
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:00 下午 2021/2/27
|
||||
func (c *Client) CommandProxyWithReceiver(ctx *Context, flag string, receiver interface{}, cmd string, param ...interface{}) error {
|
||||
@ -231,7 +231,7 @@ func (c *Client) CommandProxyWithReceiver(ctx *Context, flag string, receiver in
|
||||
|
||||
// ClientInterface 定义redis client的接口实现,方便单元测试数据mock
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:49 下午 2021/2/27
|
||||
type ClientInterface interface {
|
||||
|
Reference in New Issue
Block a user