redis

package
v0.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

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 interface{}, ttl ...time.Duration) error
	Get(key string, value interface{}) error
	Remove(key string) (err error)
	Keys(key string) ([]string, error)
}

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 Unlock

type Unlock func()

Jump to

Keyboard shortcuts

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