redis

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Nil = redis.Nil

Nil

Variables

View Source
var RedisClient *redis.Client

RedisClient

Functions

func Init

func Init() *redis.Client

func InitTestRedis

func InitTestRedis()

InitTestRedis

Types

type IdAlloc

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

IdAlloc

func (*IdAlloc) GetCurrentID

func (ia *IdAlloc) GetCurrentID() (int64, error)

GetCurrentID

func (*IdAlloc) GetKey

func (ia *IdAlloc) GetKey() string

GetKey

func (*IdAlloc) GetNewID

func (ia *IdAlloc) GetNewID(step int64) (int64, error)

GetNewID

type Lock

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

Lock

func New

func New(conn *redis.Client, key string, defaultTimeout time.Duration) *Lock

New

func NewLock

func NewLock(conn *redis.Client, key string, defaultTimeout time.Duration) *Lock

NewLock

func (*Lock) GenToken

func (l *Lock) GenToken() string

GenToken

func (*Lock) GetKey

func (l *Lock) GetKey() string

GetKey

func (*Lock) Lock

func (l *Lock) Lock(token string) (bool, error)

Lock

func (*Lock) Unlock

func (l *Lock) Unlock(token string) error

Unlock

Jump to

Keyboard shortcuts

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