redis

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: GPL-3.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const IdGoneRedisInner = "gone-redis-inner"

Variables

View Source
var (
	ErrNil           = redis.ErrNil
	Int              = redis.Int
	Int64            = redis.Int64
	Uint64           = redis.Uint64
	Float64          = redis.Float64
	String           = redis.String
	Bytes            = redis.Bytes
	Bool             = redis.Bool
	Values           = redis.Values
	Float64s         = redis.Float64s
	Strings          = redis.Strings
	ByteSlices       = redis.ByteSlices
	Int64s           = redis.Int64s
	Ints             = redis.Ints
	StringMap        = redis.StringMap
	IntMap           = redis.IntMap
	Int64Map         = redis.Int64Map
	Float64Map       = redis.Float64Map
	Positions        = redis.Positions
	Uint64s          = redis.Uint64s
	Uint64Map        = redis.Uint64Map
	SlowLogs         = redis.SlowLogs
	Latencies        = redis.Latencies
	LatencyHistories = redis.LatencyHistories
)
View Source
var ErrorLockFailed = errors.New("not lock success")

Functions

func NewInner

func NewInner() (gone.Goner, gone.GonerId)

func NewRedisCache

func NewRedisCache() (gone.Goner, gone.GonerId)

func NewRedisLocker

func NewRedisLocker() (gone.Goner, gone.GonerId)

func NewRedisPool

func NewRedisPool() (gone.Angel, gone.GonerId)

func Priest

func Priest(cemetery gone.Cemetery) error

Types

type Cache

type Cache interface {
	Put(key string, value any, ttl ...time.Duration) error
	Get(key string, value any) error
	Remove(key string) (err error)
	Keys(key string) ([]string, error)
}

type Conn added in v0.0.13

type Conn = redis.Conn

type Locker

type Locker interface {
	TryLock(key string, ttl time.Duration) (unlock Unlock, err error)
	LockAndDo(key string, fn func(), lockTime, checkPeriod time.Duration) (err error)
}

type Pool added in v0.0.10

type Pool interface {
	Get() Conn
}

type Unlock

type Unlock func()

Jump to

Keyboard shortcuts

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