Documentation ¶
Index ¶
- Constants
- Variables
- func CheckLocked(pool *Pool, key string) bool
- func DeQueue(pool *Pool, queueName string) (key string, data []byte)
- func EnQueue(pool *Pool, queueName, key string, data []byte) error
- func EnQueueReliably(pool *Pool, queue string, key string, data []byte) (err error)
- func Lock(globalPool *Pool, key string, maxRetry, expiredSecond int) error
- func LockByExpireTime(globalPool *Pool, key string, timeout time.Duration, expired int) error
- func UnLock(globalPool *Pool, key string) error
- type Pool
- func (p *Pool) AddToSet(key string, val []string) error
- func (p *Pool) Close() error
- func (p *Pool) Del(key string) error
- func (p *Pool) Do(cmdStr string, args ...any) (reply any, err error)
- func (p *Pool) Expire(key string, t int) error
- func (p *Pool) FailOver()
- func (p *Pool) Get(key string) (any, error)
- func (p *Pool) GetHashValues(hTable string, keys []string) ([]string, error)
- func (p *Pool) GetSet(key, value string) (any, error)
- func (p *Pool) GetTime() (second, microSecond int64, err error)
- func (p *Pool) GetsFromSet(key string) ([]string, error)
- func (p *Pool) HGet(hTable, key string) (any, error)
- func (p *Pool) HKeys(hTable string) ([]string, error)
- func (p *Pool) HLen(hTable string) (any, error)
- func (p *Pool) HPop(hTable, key string) (any, error)
- func (p *Pool) HSet(hTable, key, val string) (int64, error)
- func (p *Pool) HSetNX(hTable, key, val string) (int64, error)
- func (p *Pool) Incr(key string) (int64, error)
- func (p *Pool) LLen(key string) (int64, error)
- func (p *Pool) LPop(key string) (any, error)
- func (p *Pool) LPush(args ...any) error
- func (p *Pool) LRange(key string, start, end int) (any, error)
- func (p *Pool) Multi(cmds []map[string]string) (any, error)
- func (p *Pool) MultiVariable(cmds []map[string][]interface{}) (any, error)
- func (p *Pool) RPop(key string) (any, error)
- func (p *Pool) RPush(args ...any) error
- func (p *Pool) Recover()
- func (p *Pool) RmFromSet(key, val string) error
- func (p *Pool) Set(key, value string) error
- func (p *Pool) SetEx(key, value string, seconds int) error
- func (p *Pool) SetNx(key, value string) (int64, error)
- func (p *Pool) TTL(key string) (int64, error)
- type Server
Constants ¶
View Source
const (
ScriptHPop = `
local v = redis.call("HGET", KEYS[1], ARGV[1])
redis.call("HDEL", KEYS[1], ARGV[1])
return v
`
)
Variables ¶
Functions ¶
func CheckLocked ¶
func EnQueueReliably ¶
func LockByExpireTime ¶
LockByExpireTime 获取锁,可以自定义重试时长、锁超时时间。
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func NewRedisPool ¶
func (*Pool) GetHashValues ¶
func (*Pool) MultiVariable ¶
Click to show internal directories.
Click to hide internal directories.