redis

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ErrRedisNotFound = redis.Nil

ErrRedisNotFound not exist in redis

Variables

View Source
var RedisClient *redis.Client

RedisClient redis 客户端

Functions

func Init

func Init(c *Config) *redis.Client

Init 实例化一个redis client

func InitTestRedis

func InitTestRedis()

InitTestRedis 实例化一个可以用于单元测试的redis

Types

type Config

type Config struct {
	Addr         string
	Password     string
	DB           int
	MinIdleConn  int
	DialTimeout  time.Duration
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	PoolSize     int
	PoolTimeout  time.Duration
	// tracing switch
	EnableTrace bool
}

Config redis config

Jump to

Keyboard shortcuts

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