redisclient

package
v0.0.0-...-0dd36a4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConnError

func IsConnError(err error) bool

IsConnError 判断是否有错误

func RedisInit

func RedisInit(host, port, password string)

RedisInit redis 初始化

Types

type MyRedisReConn

type MyRedisReConn struct {
	RedisConn redis.Conn
	ReidsDB   int
}

func GetRedisConn

func GetRedisConn(n int) (conn *MyRedisReConn, err error)

GetRedisConn 从redis池子拿去一个n号库的链接 n int redis 对应的n号库

func (MyRedisReConn) Del

func (myredis MyRedisReConn) Del(key string) error

删除

func (MyRedisReConn) ExpiresSet

func (myredis MyRedisReConn) ExpiresSet(key, value string, expiresTime int) error

失效方式插入值

func (MyRedisReConn) Get

func (myredis MyRedisReConn) Get(key string) (string, error)

取值

func (MyRedisReConn) Redo

func (myredis MyRedisReConn) Redo(command string, opt ...interface{}) (interface{}, error)

Redo 在pool加入TestOnBorrow方法来去除扫描坏连接,并重新连接redis

func (MyRedisReConn) Set

func (myredis MyRedisReConn) Set(key, value string) error

插入值

Jump to

Keyboard shortcuts

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