cache

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICache

type ICache interface {
	WithDB(db int) ICache
	WithContext(ctx context.Context) ICache
	Get(string) interface{}
	GetString(string) (string, error)
	Set(string, interface{}, time.Duration) error
	IsExist(string) bool
	Delete(string) (int64, error)
	LPush(string, interface{}) (int64, error)
	RPop(string) interface{}
	XRead(string, int64) (interface{}, error) // default type []redis.XStream
	XAdd(string, string, []string) (string, error)
	XDel(string, string) (int64, error)
	GetLock(string, time.Duration, time.Duration) (string, error)
	ReleaseLock(string, string) bool

	Increment(string, int64) (int64, error)
	IncrementFloat(string, float64) (float64, error)
	Decrement(string, int64) (int64, error)

	Flush()

	ZAdd(string, float64, interface{}) interface{}
	ZRangeByScore(string, int64, int64) ([]string, error)
	ZRem(string, ...interface{}) error
}

type IShortCache

type IShortCache interface {
	WithDB(db int) ICache
	WithContext(ctx context.Context) ICache
	Get(string) interface{}
	GetString(string) (string, error)
	Set(string, interface{}, time.Duration) error
	IsExist(string) bool
	Delete(string) (int64, error)
	Increment(string, int64) (int64, error)
	IncrementFloat(string, float64) (float64, error)
	Decrement(string, int64) (int64, error)
	Flush()
}

Jump to

Keyboard shortcuts

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