redisc

package
v0.0.0-...-9fd2f02 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedisConcurrentLockInTime

func RedisConcurrentLockInTime(ctx context.Context, client RedisClientIOCInterface, lockKey string, lockTime time.Duration) (holdLock bool, err error)

RedisConcurrentLockInTime 获取redis并发锁,固定时间内禁止重发

Types

type RedisClient

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

func GetRedisClientSingleton

func GetRedisClientSingleton() (*RedisClient, error)

func (*RedisClient) Create

func (r *RedisClient) Create(addr, password string, db uint8) (bool, error)

func (*RedisClient) GetClient

func (r *RedisClient) GetClient() *redis.Client

type RedisClientIOCInterface

type RedisClientIOCInterface interface {
	Create(addr, password string, db uint8) (bool, error)
	GetClient() *v9.Client
}

func GetRedisClientIOCInterfaceSingleton

func GetRedisClientIOCInterfaceSingleton() (RedisClientIOCInterface, error)

type ThisRedisClient

type ThisRedisClient struct {
}

func (*ThisRedisClient) This

Jump to

Keyboard shortcuts

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