Documentation ¶
Overview ¶
redis wrapper
refer: https://github.com/smacker/opentracing-go-redis/blob/master/otredis.go, replace redis.Client with redis.ClusterClient
Index ¶
- Constants
- func GetTestRedis() (*redis.Client, error)
- func Init(cfg Config) (*redis.ClusterClient, error)
- func WrapRedisClient(ctx context.Context, client *redis.Client) *redis.Client
- func WrapRedisClusterClient(ctx context.Context, client *redis.ClusterClient) *redis.ClusterClient
- type Config
- type ErrHandleResult
Constants ¶
View Source
const ( Success = ErrHandleResult(iota) NotFound DB_ERROR )
Variables ¶
This section is empty.
Functions ¶
func GetTestRedis ¶
func WrapRedisClient ¶
WrapRedisClient adds opentracing measurements for commands and returns cloned client
func WrapRedisClusterClient ¶
func WrapRedisClusterClient(ctx context.Context, client *redis.ClusterClient) *redis.ClusterClient
WrapRedisClient adds opentracing measurements for commands and returns cloned client
Types ¶
type ErrHandleResult ¶
type ErrHandleResult int
func ErrorHandleAndLog ¶
func ErrorHandleAndLog(c *gin.Context, err error, treatNotFoundAsErr bool, desc string, key string, extra interface{}) ErrHandleResult
desc and key for log
Click to show internal directories.
Click to hide internal directories.