utilRedis

package
v0.0.0-...-a4e85ba Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ErrRedisNil = redis.Nil
View Source
const LockerKeyPrefix = "utilRedisLock_"

Variables

This section is empty.

Functions

func ErrorIsNil

func ErrorIsNil(err error) bool

Types

type RedisClient

type RedisClient struct {
	*redis.Client
	// contains filtered or unexported fields
}

func NewRedisClient

func NewRedisClient(addr string, password string, db int, dialTimeoutSeconds int, poolConnections int) (rc *RedisClient, err error)

func (*RedisClient) BitFill

func (rc *RedisClient) BitFill(key string, val int8, start int64, length int64) (err error)

func (*RedisClient) BitFindSpaceStep

func (rc *RedisClient) BitFindSpaceStep(key string, length int64, val int8, start int64, end int64, step int64) (position int64, err error)

func (*RedisClient) Clone

func (rc *RedisClient) Clone() (*RedisClient, error)

func (*RedisClient) Conf

func (rc *RedisClient) Conf() (addr string, password string, db int)

func (*RedisClient) CtxDefault

func (rc *RedisClient) CtxDefault() context.Context

func (*RedisClient) Del

func (rc *RedisClient) Del(key ...string) (err error)

func (*RedisClient) DelByPattern

func (rc *RedisClient) DelByPattern(pattern string) (err error)

func (*RedisClient) Get

func (rc *RedisClient) Get(key string) (value string, err error)

func (*RedisClient) GetDel

func (rc *RedisClient) GetDel(key string) (value string, err error)

func (*RedisClient) GetInt

func (rc *RedisClient) GetInt(key string) (value int, err error)

func (*RedisClient) GetLocker

func (rc *RedisClient) GetLocker(key string, duration time.Duration, tries int) (locker *redsync.Mutex)

func (*RedisClient) GetString

func (rc *RedisClient) GetString(key string) (value string, err error)

func (*RedisClient) GookitRedis

func (rc *RedisClient) GookitRedis() *gookitRedis.GoRedis

func (*RedisClient) Lock

func (rc *RedisClient) Lock(key string, duration time.Duration, tries int) error

func (*RedisClient) LockExtend

func (rc *RedisClient) LockExtend(key string, duration time.Duration) (bool, error)

func (*RedisClient) RedigoConn

func (rc *RedisClient) RedigoConn() (conn redigo.Conn)

func (*RedisClient) RedigoPool

func (rc *RedisClient) RedigoPool() (pool *redigo.Pool)

func (*RedisClient) Set

func (rc *RedisClient) Set(key string, value interface{}, expirations ...time.Duration) (string, error)

func (*RedisClient) TryLock

func (rc *RedisClient) TryLock(key string, duration time.Duration) error

func (*RedisClient) Unlock

func (rc *RedisClient) Unlock(key string) (bool, error)

type RedisGoConn

type RedisGoConn struct {
	// contains filtered or unexported fields
}

func GoRedisToRedisGoConn

func GoRedisToRedisGoConn(client *redis.Client) *RedisGoConn

func (*RedisGoConn) Close

func (rgc *RedisGoConn) Close() error

func (*RedisGoConn) Do

func (rgc *RedisGoConn) Do(commandName string, args ...interface{}) (reply interface{}, err error)

func (*RedisGoConn) Err

func (rgc *RedisGoConn) Err() error

func (*RedisGoConn) Flush

func (rgc *RedisGoConn) Flush() error

func (*RedisGoConn) Receive

func (rgc *RedisGoConn) Receive() (reply interface{}, err error)

func (*RedisGoConn) Send

func (rgc *RedisGoConn) Send(commandName string, args ...interface{}) error

Jump to

Keyboard shortcuts

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