xcache

package
v0.0.0-...-f0a4171 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DGet

func DGet(key, field string, value interface{}, item interface{}, query interface{}, args ...interface{}) *xvalue.Value

func DSet

func DSet(key string, val *xvalue.Value, field string, model interface{}, query interface{}, args ...interface{}) error

func DSetAlways

func DSetAlways(key, pkey string, val *xvalue.Value, field string, item interface{}) error

func Del

func Del(keys ...string)

func Exists

func Exists(keys ...string) int64

func Expire

func Expire(key string, exp time.Duration)

func Get

func Get(key string) string

func HDel

func HDel(key string, field ...string) error

func HGet

func HGet(key, field string) string

func HGetAll

func HGetAll(key string) map[string]string

func HIncr

func HIncr(key, field string, incr int64) error

func HSet

func HSet(key string, val interface{}) error

func Initialize

func Initialize(addr string, pass string)

初始化缓存,如果addr为空,则使用内存缓存

func SCard

func SCard(key string) int64

func SDel

func SDel(key string, val ...interface{}) error

func SIsMember

func SIsMember(key string, val interface{}) bool

func SSet

func SSet(key string, val ...interface{}) error

func Set

func Set(key string, value string, exp time.Duration) error

func ZCard

func ZCard(key string) int64

func ZDel

func ZDel(key string, member ...interface{}) error

func ZIncrBy

func ZIncrBy(key, member string, increment float64) float64

func ZRange

func ZRange(key string, start, stop int64) []string

func ZRangeByScore

func ZRangeByScore(key string, min, max string) []string

func ZRangeByScoreLimit

func ZRangeByScoreLimit(key string, min, max string, offset, count int64) []string

func ZRevRangeByScore

func ZRevRangeByScore(key string, min, max string) []string

func ZRevRangeByScoreLimit

func ZRevRangeByScoreLimit(key string, min, max string, offset, count int64) []string

func ZScore

func ZScore(key, member string) float64

func ZSet

func ZSet(key string, members ...*Z) error

Types

type ICache

type ICache interface {
	Expire(key string, exp time.Duration)
	SSet(key string, val ...interface{}) error
	SDel(key string, val ...interface{}) error
	SCard(key string) int64
	SIsMember(key string, val interface{}) bool
	ZSet(key string, members ...*Z) error
	ZDel(key string, member ...interface{}) error
	ZCard(key string) int64
	ZRange(key string, start, stop int64) []string
	ZScore(key, member string) float64
	ZRangeByScoreLimit(key string, min, max string, offset, count int64) []string
	ZRangeByScore(key string, min, max string) []string
	ZRangeByScoreWithScores(key string, min, max string) []Z
	ZRevRangeByScoreLimitWithScores(key string, min, max string, offset, count int64) []Z
	ZRevRangeByScoreWithScores(key string, min, max string) []Z
	ZRevRangeByScoreLimit(key string, min, max string, offset, count int64) []string
	ZRevRangeByScore(key string, min, max string) []string
	ZIncrBy(key, member string, increment float64) float64
	Del(keys ...string)
	HGetAll(key string) map[string]string
	Exists(keys ...string) int64
	Get(key string) string
	Set(key string, value string, exp time.Duration) error
	HGet(key, field string) string
	HSet(key string, val interface{}) error
	HDel(key string, field ...string) error
	HIncr(key, field string, incr int64) error
}

type XMemory

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

func NewXMemory

func NewXMemory() *XMemory

func (*XMemory) Del

func (s *XMemory) Del(keys ...string)

func (*XMemory) Exists

func (s *XMemory) Exists(keys ...string) (result int64)

func (*XMemory) Expire

func (s *XMemory) Expire(key string, exp time.Duration)

func (*XMemory) Get

func (s *XMemory) Get(key string) string

func (*XMemory) HDel

func (s *XMemory) HDel(key string, field ...string) error

func (*XMemory) HGet

func (s *XMemory) HGet(key, field string) string

func (*XMemory) HGetAll

func (s *XMemory) HGetAll(key string) map[string]string

func (*XMemory) HIncr

func (s *XMemory) HIncr(key, field string, incr int64) error

func (*XMemory) HSet

func (s *XMemory) HSet(key string, val interface{}) error

func (*XMemory) IsHash

func (s *XMemory) IsHash(key string) bool

func (*XMemory) SCard

func (s *XMemory) SCard(key string) int64

func (*XMemory) SDel

func (s *XMemory) SDel(key string, val ...interface{}) error

func (*XMemory) SIsMember

func (s *XMemory) SIsMember(key string, val interface{}) bool

func (*XMemory) SSet

func (s *XMemory) SSet(key string, val ...interface{}) error

func (*XMemory) Set

func (s *XMemory) Set(key string, value string, exp time.Duration) error

func (*XMemory) ZCard

func (s *XMemory) ZCard(key string) int64

func (*XMemory) ZDel

func (s *XMemory) ZDel(key string, member ...interface{}) error

func (*XMemory) ZIncrBy

func (s *XMemory) ZIncrBy(key, member string, increment float64) float64

func (*XMemory) ZRange

func (s *XMemory) ZRange(key string, start, stop int64) []string

func (*XMemory) ZRangeByScore

func (s *XMemory) ZRangeByScore(key string, min, max string) []string

func (*XMemory) ZRangeByScoreLimit

func (s *XMemory) ZRangeByScoreLimit(key string, min, max string, offset, count int64) []string

func (*XMemory) ZRangeByScoreWithScores

func (s *XMemory) ZRangeByScoreWithScores(key string, min, max string) []Z

func (*XMemory) ZRevRangeByScore

func (s *XMemory) ZRevRangeByScore(key string, min, max string) []string

func (*XMemory) ZRevRangeByScoreLimit

func (s *XMemory) ZRevRangeByScoreLimit(key string, min, max string, offset, count int64) []string

func (*XMemory) ZRevRangeByScoreLimitWithScores

func (s *XMemory) ZRevRangeByScoreLimitWithScores(key string, min, max string, offset, count int64) []Z

func (*XMemory) ZRevRangeByScoreWithScores

func (s *XMemory) ZRevRangeByScoreWithScores(key string, min, max string) []Z

func (*XMemory) ZScore

func (s *XMemory) ZScore(key, member string) float64

func (*XMemory) ZSet

func (s *XMemory) ZSet(key string, members ...*Z) error

type XRedis

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

func NewXRedis

func NewXRedis(addr, pass string) *XRedis

func (*XRedis) Del

func (s *XRedis) Del(keys ...string)

func (*XRedis) Exists

func (s *XRedis) Exists(keys ...string) int64

func (*XRedis) Expire

func (s *XRedis) Expire(key string, exp time.Duration)

func (*XRedis) Get

func (s *XRedis) Get(key string) string

func (*XRedis) HDel

func (s *XRedis) HDel(key string, field ...string) error

func (*XRedis) HGet

func (s *XRedis) HGet(key, field string) string

func (*XRedis) HGetAll

func (s *XRedis) HGetAll(key string) map[string]string

func (*XRedis) HIncr

func (s *XRedis) HIncr(key, field string, incr int64) error

func (*XRedis) HSet

func (s *XRedis) HSet(key string, val interface{}) error

func (*XRedis) SCard

func (s *XRedis) SCard(key string) int64

func (*XRedis) SDel

func (s *XRedis) SDel(key string, val ...interface{}) error

func (*XRedis) SIsMember

func (s *XRedis) SIsMember(key string, val interface{}) bool

func (*XRedis) SSet

func (s *XRedis) SSet(key string, val ...interface{}) error

func (*XRedis) Set

func (s *XRedis) Set(key string, value string, exp time.Duration) error

func (*XRedis) ZCard

func (s *XRedis) ZCard(key string) int64

func (*XRedis) ZDel

func (s *XRedis) ZDel(key string, member ...interface{}) error

func (*XRedis) ZIncrBy

func (s *XRedis) ZIncrBy(key, member string, increment float64) float64

func (*XRedis) ZRange

func (s *XRedis) ZRange(key string, start, stop int64) []string

func (*XRedis) ZRangeByScore

func (s *XRedis) ZRangeByScore(key string, min, max string) []string

func (*XRedis) ZRangeByScoreLimit

func (s *XRedis) ZRangeByScoreLimit(key string, min, max string, offset, count int64) []string

func (*XRedis) ZRangeByScoreWithScores

func (s *XRedis) ZRangeByScoreWithScores(key string, min, max string) []Z

func (*XRedis) ZRevRangeByScore

func (s *XRedis) ZRevRangeByScore(key string, min, max string) []string

func (*XRedis) ZRevRangeByScoreLimit

func (s *XRedis) ZRevRangeByScoreLimit(key string, min, max string, offset, count int64) []string

func (*XRedis) ZRevRangeByScoreLimitWithScores

func (s *XRedis) ZRevRangeByScoreLimitWithScores(key string, min, max string, offset, count int64) []Z

func (*XRedis) ZRevRangeByScoreWithScores

func (s *XRedis) ZRevRangeByScoreWithScores(key string, min, max string) []Z

func (*XRedis) ZScore

func (s *XRedis) ZScore(key, member string) float64

func (*XRedis) ZSet

func (s *XRedis) ZSet(key string, members ...*Z) error

type Z

type Z struct {
	S float64
	M interface{}
}

func ZRangeByScoreWithScores

func ZRangeByScoreWithScores(key string, min, max string) []Z

func ZRevRangeByScoreLimitWithScores

func ZRevRangeByScoreLimitWithScores(key string, min, max string, offset, count int64) []Z

func ZRevRangeByScoreWithScores

func ZRevRangeByScoreWithScores(key string, min, max string) []Z

Jump to

Keyboard shortcuts

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