cache

package
v0.0.0-...-baaee6e Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchResult

type BatchResult struct {
	Value interface{}
	Error error
}

Optional: Add batch operations support

type ListOp

type ListOp struct {
	Op    string
	Key   string
	Value string
	Index int
}

type ListOpResult

type ListOpResult struct {
	Value interface{}
	Error error
}

type MemoryAnalytics

type MemoryAnalytics struct {
	// General stats
	TotalAllocated int64
	TotalFreed     int64
	CurrentlyInUse int64
	MaxMemoryUsed  int64
	LastGCTime     time.Time

	// Per data structure stats
	StringMemory int64
	HashMemory   int64
	ListMemory   int64
	SetMemory    int64
	ZSetMemory   int64

	// Memory fragmentation
	FragmentationRatio float64

	// Operation stats
	AllocationCount int64
	FreeCount       int64

	// Size stats
	KeyCount        int64
	ExpiredKeyCount int64
	EvictedKeyCount int64

	HLLMemory         int64
	JSONMemory        int64
	StreamMemory      int64
	StreamGroupMemory int64
	BitmapMemory      int64
}

type MemoryCache

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

func NewMemoryCache

func NewMemoryCache() *MemoryCache

func (*MemoryCache) AddToTransaction

func (c *MemoryCache) AddToTransaction(cmd models.Command) error

func (*MemoryCache) BatchKeys

func (c *MemoryCache) BatchKeys(patterns []string) map[string][]string

Optional: Add batch operations for better performance

func (*MemoryCache) BatchLRange

func (c *MemoryCache) BatchLRange(ranges map[string][2]int) map[string][]string

func (*MemoryCache) BatchOp

func (c *MemoryCache) BatchOp(ops []struct {
	Op    string
	Key   string
	Value interface{}
}) []BatchResult

func (*MemoryCache) BatchTTL

func (c *MemoryCache) BatchTTL(keys []string) map[string]int

Optional: Add TTL batch operations

func (*MemoryCache) BitCount

func (c *MemoryCache) BitCount(key string, start, end int64) (int64, error)

func (*MemoryCache) BitField

func (c *MemoryCache) BitField(key string, commands []models.BitFieldCommand) ([]int64, error)

func (*MemoryCache) BitFieldRO

func (c *MemoryCache) BitFieldRO(key string, commands []models.BitFieldCommand) ([]int64, error)

func (*MemoryCache) BitOp

func (c *MemoryCache) BitOp(operation string, destkey string, keys ...string) (int64, error)

func (*MemoryCache) BitPos

func (c *MemoryCache) BitPos(key string, bit int, start, end int64, reverse bool) (int64, error)

func (*MemoryCache) DBSize

func (c *MemoryCache) DBSize() int

DBSize returns the total number of keys in the cache

func (*MemoryCache) Defragment

func (c *MemoryCache) Defragment()

func (*MemoryCache) Del

func (c *MemoryCache) Del(key string) (bool, error)

func (*MemoryCache) DeleteJSON

func (c *MemoryCache) DeleteJSON(key string) bool

func (*MemoryCache) Discard

func (c *MemoryCache) Discard() error

func (*MemoryCache) Exec

func (c *MemoryCache) Exec() ([]models.Value, error)

func (*MemoryCache) ExecPipeline

func (c *MemoryCache) ExecPipeline(pl *models.Pipeline) []models.Value

func (*MemoryCache) Exists

func (c *MemoryCache) Exists(key string) bool

func (*MemoryCache) Expire

func (c *MemoryCache) Expire(key string, seconds int) error

func (*MemoryCache) ExpireAt

func (c *MemoryCache) ExpireAt(key string, timestamp int64) error

ExpireAt sets an absolute Unix timestamp when the key should expire

func (*MemoryCache) ExpireTime

func (c *MemoryCache) ExpireTime(key string) (int64, error)

ExpireTime returns the absolute Unix timestamp when the key will expire Returns:

  • timestamp: Unix timestamp when the key will expire
  • -1: if the key exists but has no associated expiry
  • -2: if the key does not exist

func (*MemoryCache) FlushAll

func (c *MemoryCache) FlushAll()

func (*MemoryCache) Get

func (c *MemoryCache) Get(key string) (string, bool)

func (*MemoryCache) GetBit

func (c *MemoryCache) GetBit(key string, offset int64) (int, error)

func (*MemoryCache) GetBloomFilterStats

func (c *MemoryCache) GetBloomFilterStats() models.BloomFilterStats

func (*MemoryCache) GetDefragStats

func (c *MemoryCache) GetDefragStats() map[string]interface{}

Helper function to get memory stats for monitoring defragmentation

func (*MemoryCache) GetJSON

func (c *MemoryCache) GetJSON(key string) (interface{}, bool)

func (*MemoryCache) GetKeyVersion

func (c *MemoryCache) GetKeyVersion(key string) int64

func (*MemoryCache) GetMemoryAnalytics

func (c *MemoryCache) GetMemoryAnalytics() *MemoryAnalytics

func (*MemoryCache) GetMemoryStats

func (c *MemoryCache) GetMemoryStats() models.MemoryStats

Memory istatistiklerini getir

func (*MemoryCache) HDel

func (c *MemoryCache) HDel(hash string, field string) (bool, error)

func (*MemoryCache) HGet

func (c *MemoryCache) HGet(hash string, key string) (string, bool)

func (*MemoryCache) HGetAll

func (c *MemoryCache) HGetAll(hash string) map[string]string

func (*MemoryCache) HIncrBy

func (c *MemoryCache) HIncrBy(key, field string, increment int64) (int64, error)

HIncrBy increments the integer value of a hash field by the given increment

func (*MemoryCache) HIncrByFloat

func (c *MemoryCache) HIncrByFloat(key, field string, increment float64) (float64, error)

HIncrByFloat increments the float value of a hash field by the given increment

func (*MemoryCache) HScan

func (c *MemoryCache) HScan(hash string, cursor int, matchPattern string, count int) ([]string, int)

HScan implements Redis HSCAN command with optimized pattern matching

func (*MemoryCache) HSet

func (c *MemoryCache) HSet(hash string, key string, value string) error

func (*MemoryCache) Incr

func (c *MemoryCache) Incr(key string) (int, error)

func (*MemoryCache) IncrCommandCount

func (c *MemoryCache) IncrCommandCount()

func (*MemoryCache) Info

func (c *MemoryCache) Info() map[string]string

func (*MemoryCache) IsInTransaction

func (c *MemoryCache) IsInTransaction() bool

func (*MemoryCache) Keys

func (c *MemoryCache) Keys(matchPattern string) []string

Keys implements Redis KEYS command with optimized pattern matching

func (*MemoryCache) LIndex

func (c *MemoryCache) LIndex(key string, index int) (string, bool)

func (*MemoryCache) LInsert

func (c *MemoryCache) LInsert(key string, before bool, pivot string, value string) (int, error)

func (*MemoryCache) LLen

func (c *MemoryCache) LLen(key string) int

List Operations

func (*MemoryCache) LPop

func (c *MemoryCache) LPop(key string) (string, bool)

func (*MemoryCache) LPos

func (c *MemoryCache) LPos(key string, element string) (int, bool)

LPOS returns the index of the first matching element in a list

func (*MemoryCache) LPush

func (c *MemoryCache) LPush(key string, value string) (int, error)

func (*MemoryCache) LPushX

func (c *MemoryCache) LPushX(key string, value string) (int, error)

LPUSHX inserts elements at the head of the list only if the list exists

func (*MemoryCache) LRange

func (c *MemoryCache) LRange(key string, start, stop int) ([]string, error)

func (*MemoryCache) LRem

func (c *MemoryCache) LRem(key string, count int, value string) (int, error)

func (*MemoryCache) LSet

func (c *MemoryCache) LSet(key string, index int, value string) error

func (*MemoryCache) LTrim

func (c *MemoryCache) LTrim(key string, start int, stop int) error

LTRIM trims a list to the specified range

func (*MemoryCache) Multi

func (c *MemoryCache) Multi() error

func (*MemoryCache) PFAdd

func (c *MemoryCache) PFAdd(key string, elements ...string) (bool, error)

func (*MemoryCache) PFCount

func (c *MemoryCache) PFCount(keys ...string) (int64, error)

func (*MemoryCache) PFMerge

func (c *MemoryCache) PFMerge(destKey string, sourceKeys ...string) error

func (*MemoryCache) Pipeline

func (c *MemoryCache) Pipeline() *models.Pipeline

func (*MemoryCache) RPop

func (c *MemoryCache) RPop(key string) (string, bool)

func (*MemoryCache) RPush

func (c *MemoryCache) RPush(key string, value string) (int, error)

func (*MemoryCache) RPushX

func (c *MemoryCache) RPushX(key string, value string) (int, error)

RPUSHX inserts elements at the tail of the list only if the list exists

func (*MemoryCache) Rename

func (c *MemoryCache) Rename(oldKey, newKey string) error

func (*MemoryCache) SAdd

func (c *MemoryCache) SAdd(key string, member string) (bool, error)

func (*MemoryCache) SCard

func (c *MemoryCache) SCard(key string) int

func (*MemoryCache) SDiff

func (c *MemoryCache) SDiff(keys ...string) []string

func (*MemoryCache) SInter

func (c *MemoryCache) SInter(keys ...string) []string

Set Intersection and Union

func (*MemoryCache) SIsMember

func (c *MemoryCache) SIsMember(key string, member string) bool

func (*MemoryCache) SMembers

func (c *MemoryCache) SMembers(key string) ([]string, error)

Set Operations

func (*MemoryCache) SRem

func (c *MemoryCache) SRem(key string, member string) (bool, error)

func (*MemoryCache) SUnion

func (c *MemoryCache) SUnion(keys ...string) []string

func (*MemoryCache) Scan

func (c *MemoryCache) Scan(cursor int, matchPattern string, count int) ([]string, int)

Scan implements Redis SCAN command with optimized iteration over all key types

func (*MemoryCache) Set

func (c *MemoryCache) Set(key string, value string) error

func (*MemoryCache) SetBit

func (c *MemoryCache) SetBit(key string, offset int64, value int) (int, error)

func (*MemoryCache) SetJSON

func (c *MemoryCache) SetJSON(key string, value interface{}) error

func (*MemoryCache) SetMemoryLimit

func (c *MemoryCache) SetMemoryLimit(maxBytes int64)

Add memory usage limits

func (*MemoryCache) StartDefragmentation

func (c *MemoryCache) StartDefragmentation(interval time.Duration, threshold float64)

StartDefragmentation starts automatic defragmentation based on memory threshold

func (*MemoryCache) StartMemoryMonitor

func (c *MemoryCache) StartMemoryMonitor(interval time.Duration)

Add memory monitoring capabilities

func (*MemoryCache) TTL

func (c *MemoryCache) TTL(key string) int

TTL implementation with sync.Map

func (*MemoryCache) Type

func (c *MemoryCache) Type(key string) string

func (*MemoryCache) Unwatch

func (c *MemoryCache) Unwatch() error

func (*MemoryCache) Watch

func (c *MemoryCache) Watch(keys ...string) error

func (*MemoryCache) WithRetry

func (c *MemoryCache) WithRetry(strategy models.RetryStrategy) ports.Cache

func (*MemoryCache) XACK

func (c *MemoryCache) XACK(key, group string, ids ...string) (int64, error)

func (*MemoryCache) XAdd

func (c *MemoryCache) XAdd(key string, id string, fields map[string]string) error

func (*MemoryCache) XAutoClaim

func (c *MemoryCache) XAutoClaim(key, group, consumer string, minIdleTime int64, start string, count int) ([]string, []models.StreamEntry, string, error)

func (*MemoryCache) XClaim

func (c *MemoryCache) XClaim(key, group, consumer string, minIdleTime int64, ids ...string) ([]models.StreamEntry, error)

func (*MemoryCache) XDEL

func (c *MemoryCache) XDEL(key string, ids ...string) (int64, error)

func (*MemoryCache) XGroupCreate

func (c *MemoryCache) XGroupCreate(key, group, id string) error

func (*MemoryCache) XGroupCreateConsumer

func (c *MemoryCache) XGroupCreateConsumer(key, group, consumer string) (int64, error)

func (*MemoryCache) XGroupDelConsumer

func (c *MemoryCache) XGroupDelConsumer(key, group, consumer string) (int64, error)

func (*MemoryCache) XGroupDestroy

func (c *MemoryCache) XGroupDestroy(key, group string) (int64, error)

func (*MemoryCache) XGroupSetID

func (c *MemoryCache) XGroupSetID(key, group, id string) error

func (*MemoryCache) XInfoConsumers

func (c *MemoryCache) XInfoConsumers(key, group string) ([]models.StreamConsumer, error)

func (*MemoryCache) XInfoGroups

func (c *MemoryCache) XInfoGroups(key string) ([]models.StreamGroup, error)

func (*MemoryCache) XInfoStream

func (c *MemoryCache) XInfoStream(key string) (*models.StreamInfo, error)

func (*MemoryCache) XLEN

func (c *MemoryCache) XLEN(key string) int64

func (*MemoryCache) XPENDING

func (c *MemoryCache) XPENDING(key, group string) (int64, error)

func (*MemoryCache) XRANGE

func (c *MemoryCache) XRANGE(key, start, end string, count int) ([]models.StreamEntry, error)

func (*MemoryCache) XREAD

func (c *MemoryCache) XREAD(keys []string, ids []string, count int) (map[string][]models.StreamEntry, error)

func (*MemoryCache) XREVRANGE

func (c *MemoryCache) XREVRANGE(key, start, end string, count int) ([]models.StreamEntry, error)

func (*MemoryCache) XSETID

func (c *MemoryCache) XSETID(key string, id string) error

func (*MemoryCache) XTRIM

func (c *MemoryCache) XTRIM(key string, strategy string, threshold int64) (int64, error)

func (*MemoryCache) ZAdd

func (c *MemoryCache) ZAdd(key string, score float64, member string) error

Basic operations

func (*MemoryCache) ZCard

func (c *MemoryCache) ZCard(key string) int

func (*MemoryCache) ZCount

func (c *MemoryCache) ZCount(key string, min, max float64) int

func (*MemoryCache) ZDiff

func (c *MemoryCache) ZDiff(keys ...string) []string

func (*MemoryCache) ZDiffStore

func (c *MemoryCache) ZDiffStore(destination string, keys ...string) (int, error)

func (*MemoryCache) ZIncrBy

func (c *MemoryCache) ZIncrBy(key string, increment float64, member string) (float64, error)

Score operations

func (*MemoryCache) ZInter

func (c *MemoryCache) ZInter(keys ...string) []string

func (*MemoryCache) ZInterCard

func (c *MemoryCache) ZInterCard(keys ...string) (int, error)

func (*MemoryCache) ZInterStore

func (c *MemoryCache) ZInterStore(destination string, keys []string, weights []float64) (int, error)

func (*MemoryCache) ZLexCount

func (c *MemoryCache) ZLexCount(key string, min, max string) (int, error)

func (*MemoryCache) ZPopMax

func (c *MemoryCache) ZPopMax(key string) (models.ZSetMember, bool)

Pop operations

func (*MemoryCache) ZPopMaxN

func (c *MemoryCache) ZPopMaxN(key string, count int) []models.ZSetMember

func (*MemoryCache) ZPopMin

func (c *MemoryCache) ZPopMin(key string) (models.ZSetMember, bool)

func (*MemoryCache) ZPopMinN

func (c *MemoryCache) ZPopMinN(key string, count int) []models.ZSetMember

func (*MemoryCache) ZRandMember

func (c *MemoryCache) ZRandMember(key string, count int, withScores bool) []models.ZSetMember

Random member operations

func (*MemoryCache) ZRandMemberWithoutScores

func (c *MemoryCache) ZRandMemberWithoutScores(key string, count int) []string

func (*MemoryCache) ZRange

func (c *MemoryCache) ZRange(key string, start, stop int) []string

Range operations

func (*MemoryCache) ZRangeByLex

func (c *MemoryCache) ZRangeByLex(key string, min, max string) []string

Lex operations

func (*MemoryCache) ZRangeByScore

func (c *MemoryCache) ZRangeByScore(key string, min, max float64) []string

func (*MemoryCache) ZRangeByScoreWithScores

func (c *MemoryCache) ZRangeByScoreWithScores(key string, min, max float64) []models.ZSetMember

func (*MemoryCache) ZRangeStore

func (c *MemoryCache) ZRangeStore(destination string, source string, start, stop int, withScores bool) (int, error)

func (*MemoryCache) ZRangeWithScores

func (c *MemoryCache) ZRangeWithScores(key string, start, stop int) []models.ZSetMember

func (*MemoryCache) ZRank

func (c *MemoryCache) ZRank(key string, member string) (int, bool)

Rank operations

func (*MemoryCache) ZRem

func (c *MemoryCache) ZRem(key string, member string) error

func (*MemoryCache) ZRemRangeByLex

func (c *MemoryCache) ZRemRangeByLex(key string, min, max string) (int, error)

func (*MemoryCache) ZRemRangeByRank

func (c *MemoryCache) ZRemRangeByRank(key string, start, stop int) (int, error)

func (*MemoryCache) ZRemRangeByScore

func (c *MemoryCache) ZRemRangeByScore(key string, min, max float64) (int, error)

func (*MemoryCache) ZRevRange

func (c *MemoryCache) ZRevRange(key string, start, stop int) []string

func (*MemoryCache) ZRevRangeByLex

func (c *MemoryCache) ZRevRangeByLex(key string, max, min string) []string

func (*MemoryCache) ZRevRangeByScore

func (c *MemoryCache) ZRevRangeByScore(key string, max, min float64) []string

func (*MemoryCache) ZRevRangeWithScores

func (c *MemoryCache) ZRevRangeWithScores(key string, start, stop int) []models.ZSetMember

func (*MemoryCache) ZRevRank

func (c *MemoryCache) ZRevRank(key string, member string) (int, bool)

func (*MemoryCache) ZScan

func (c *MemoryCache) ZScan(key string, cursor int, match string, count int) ([]models.ZSetMember, int)

Scan operations

func (*MemoryCache) ZScore

func (c *MemoryCache) ZScore(key string, member string) (float64, bool)

func (*MemoryCache) ZUnion

func (c *MemoryCache) ZUnion(keys ...string) []models.ZSetMember

Set operations

func (*MemoryCache) ZUnionStore

func (c *MemoryCache) ZUnionStore(destination string, keys []string, weights []float64) (int, error)

type RetryDecorator

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

func NewRetryDecorator

func NewRetryDecorator(cache *MemoryCache, strategy models.RetryStrategy) *RetryDecorator

func (*RetryDecorator) AddToTransaction

func (rd *RetryDecorator) AddToTransaction(cmd models.Command) error

func (*RetryDecorator) BitCount

func (rd *RetryDecorator) BitCount(key string, start, end int64) (int64, error)

func (*RetryDecorator) BitField

func (rd *RetryDecorator) BitField(key string, commands []models.BitFieldCommand) ([]int64, error)

func (*RetryDecorator) BitFieldRO

func (rd *RetryDecorator) BitFieldRO(key string, commands []models.BitFieldCommand) ([]int64, error)

func (*RetryDecorator) BitOp

func (rd *RetryDecorator) BitOp(operation string, destkey string, keys ...string) (int64, error)

func (*RetryDecorator) BitPos

func (rd *RetryDecorator) BitPos(key string, bit int, start, end int64, reverse bool) (int64, error)

func (*RetryDecorator) DBSize

func (rd *RetryDecorator) DBSize() int

func (*RetryDecorator) Defragment

func (rd *RetryDecorator) Defragment()

func (*RetryDecorator) Del

func (rd *RetryDecorator) Del(key string) (bool, error)

func (*RetryDecorator) DeleteJSON

func (rd *RetryDecorator) DeleteJSON(key string) bool

Add DeleteJSON with retry logic

func (*RetryDecorator) Discard

func (rd *RetryDecorator) Discard() error

func (*RetryDecorator) Exec

func (rd *RetryDecorator) Exec() ([]models.Value, error)

func (*RetryDecorator) ExecPipeline

func (rd *RetryDecorator) ExecPipeline(pipeline *models.Pipeline) []models.Value

func (*RetryDecorator) Exists

func (rd *RetryDecorator) Exists(key string) bool

func (*RetryDecorator) Expire

func (rd *RetryDecorator) Expire(key string, seconds int) error

func (*RetryDecorator) ExpireAt

func (rd *RetryDecorator) ExpireAt(key string, timestamp int64) error

ExpireAt sets an absolute Unix timestamp when the key should expire

func (*RetryDecorator) ExpireTime

func (rd *RetryDecorator) ExpireTime(key string) (int64, error)

ExpireTime returns the absolute Unix timestamp when the key will expire

func (*RetryDecorator) FlushAll

func (rd *RetryDecorator) FlushAll()

func (*RetryDecorator) Get

func (rd *RetryDecorator) Get(key string) (string, bool)

func (*RetryDecorator) GetBit

func (rd *RetryDecorator) GetBit(key string, offset int64) (int, error)

func (*RetryDecorator) GetJSON

func (rd *RetryDecorator) GetJSON(key string) (interface{}, bool)

Add GetJSON with retry logic

func (*RetryDecorator) GetKeyVersion

func (rd *RetryDecorator) GetKeyVersion(key string) int64

func (*RetryDecorator) GetMemoryStats

func (rd *RetryDecorator) GetMemoryStats() models.MemoryStats

func (*RetryDecorator) HDel

func (rd *RetryDecorator) HDel(hash string, field string) (bool, error)

func (*RetryDecorator) HGet

func (rd *RetryDecorator) HGet(hash string, key string) (string, bool)

func (*RetryDecorator) HGetAll

func (rd *RetryDecorator) HGetAll(hash string) map[string]string

func (*RetryDecorator) HIncrBy

func (rd *RetryDecorator) HIncrBy(key, field string, increment int64) (int64, error)

HIncrBy increments the integer value of a hash field by the given increment

func (*RetryDecorator) HIncrByFloat

func (rd *RetryDecorator) HIncrByFloat(key, field string, increment float64) (float64, error)

HIncrByFloat increments the float value of a hash field by the given increment

func (*RetryDecorator) HScan

func (rd *RetryDecorator) HScan(hash string, cursor int, pattern string, count int) ([]string, int)

func (*RetryDecorator) HSet

func (rd *RetryDecorator) HSet(hash string, key string, value string) error

func (*RetryDecorator) Incr

func (rd *RetryDecorator) Incr(key string) (int, error)

func (*RetryDecorator) IncrCommandCount

func (rd *RetryDecorator) IncrCommandCount()

func (*RetryDecorator) Info

func (rd *RetryDecorator) Info() map[string]string

func (*RetryDecorator) IsInTransaction

func (rd *RetryDecorator) IsInTransaction() bool

func (*RetryDecorator) Keys

func (rd *RetryDecorator) Keys(pattern string) []string

func (*RetryDecorator) LIndex

func (rd *RetryDecorator) LIndex(key string, index int) (string, bool)

LIndex returns an element from a list by its index with retry logic

func (*RetryDecorator) LInsert

func (rd *RetryDecorator) LInsert(key string, before bool, pivot string, value string) (int, error)

LInsert inserts an element before or after a pivot in a list with retry logic

func (*RetryDecorator) LLen

func (rd *RetryDecorator) LLen(key string) int

func (*RetryDecorator) LPop

func (rd *RetryDecorator) LPop(key string) (string, bool)

func (*RetryDecorator) LPos

func (rd *RetryDecorator) LPos(key string, element string) (int, bool)

LPOS with retry logic

func (*RetryDecorator) LPush

func (rd *RetryDecorator) LPush(key string, value string) (int, error)

func (*RetryDecorator) LPushX

func (rd *RetryDecorator) LPushX(key string, value string) (int, error)

LPUSHX with retry logic

func (*RetryDecorator) LRange

func (rd *RetryDecorator) LRange(key string, start, stop int) ([]string, error)

func (*RetryDecorator) LRem

func (rd *RetryDecorator) LRem(key string, count int, value string) (int, error)

func (*RetryDecorator) LSet

func (rd *RetryDecorator) LSet(key string, index int, value string) error

func (*RetryDecorator) LTrim

func (rd *RetryDecorator) LTrim(key string, start int, stop int) error

LTRIM with retry logic

func (*RetryDecorator) Multi

func (rd *RetryDecorator) Multi() error

func (*RetryDecorator) PFAdd

func (rd *RetryDecorator) PFAdd(key string, elements ...string) (bool, error)

func (*RetryDecorator) PFCount

func (rd *RetryDecorator) PFCount(keys ...string) (int64, error)

func (*RetryDecorator) PFMerge

func (rd *RetryDecorator) PFMerge(destKey string, sourceKeys ...string) error

func (*RetryDecorator) Pipeline

func (rd *RetryDecorator) Pipeline() *models.Pipeline

func (*RetryDecorator) RPop

func (rd *RetryDecorator) RPop(key string) (string, bool)

func (*RetryDecorator) RPush

func (rd *RetryDecorator) RPush(key string, value string) (int, error)

func (*RetryDecorator) RPushX

func (rd *RetryDecorator) RPushX(key string, value string) (int, error)

RPUSHX with retry logic

func (*RetryDecorator) Rename

func (rd *RetryDecorator) Rename(oldKey, newKey string) error

func (*RetryDecorator) SAdd

func (rd *RetryDecorator) SAdd(key string, member string) (bool, error)

func (*RetryDecorator) SCard

func (rd *RetryDecorator) SCard(key string) int

func (*RetryDecorator) SDiff

func (rd *RetryDecorator) SDiff(keys ...string) []string

func (*RetryDecorator) SInter

func (rd *RetryDecorator) SInter(keys ...string) []string

func (*RetryDecorator) SIsMember

func (rd *RetryDecorator) SIsMember(key string, member string) bool

func (*RetryDecorator) SMembers

func (rd *RetryDecorator) SMembers(key string) ([]string, error)

func (*RetryDecorator) SRem

func (rd *RetryDecorator) SRem(key string, member string) (bool, error)

func (*RetryDecorator) SUnion

func (rd *RetryDecorator) SUnion(keys ...string) []string

func (*RetryDecorator) Scan

func (rd *RetryDecorator) Scan(cursor int, pattern string, count int) ([]string, int)

func (*RetryDecorator) Set

func (rd *RetryDecorator) Set(key string, value string) error

func (*RetryDecorator) SetBit

func (rd *RetryDecorator) SetBit(key string, offset int64, value int) (int, error)

func (*RetryDecorator) SetJSON

func (rd *RetryDecorator) SetJSON(key string, value interface{}) error

Add SetJSON with retry logic

func (*RetryDecorator) StartDefragmentation

func (rd *RetryDecorator) StartDefragmentation(interval time.Duration, threshold float64)

func (*RetryDecorator) TTL

func (rd *RetryDecorator) TTL(key string) int

func (*RetryDecorator) Type

func (rd *RetryDecorator) Type(key string) string

func (*RetryDecorator) Unwatch

func (rd *RetryDecorator) Unwatch() error

func (*RetryDecorator) Watch

func (rd *RetryDecorator) Watch(keys ...string) error

func (*RetryDecorator) WithRetry

func (rd *RetryDecorator) WithRetry(strategy models.RetryStrategy) ports.Cache

func (*RetryDecorator) XACK

func (rd *RetryDecorator) XACK(key, group string, ids ...string) (int64, error)

func (*RetryDecorator) XAdd

func (rd *RetryDecorator) XAdd(key string, id string, fields map[string]string) error

func (*RetryDecorator) XAutoClaim

func (rd *RetryDecorator) XAutoClaim(key, group, consumer string, minIdleTime int64, start string, count int) ([]string, []models.StreamEntry, string, error)

func (*RetryDecorator) XClaim

func (rd *RetryDecorator) XClaim(key, group, consumer string, minIdleTime int64, ids ...string) ([]models.StreamEntry, error)

func (*RetryDecorator) XDEL

func (rd *RetryDecorator) XDEL(key string, ids ...string) (int64, error)

func (*RetryDecorator) XGroupCreate

func (rd *RetryDecorator) XGroupCreate(key, group, id string) error

func (*RetryDecorator) XGroupCreateConsumer

func (rd *RetryDecorator) XGroupCreateConsumer(key, group, consumer string) (int64, error)

func (*RetryDecorator) XGroupDelConsumer

func (rd *RetryDecorator) XGroupDelConsumer(key, group, consumer string) (int64, error)

func (*RetryDecorator) XGroupDestroy

func (rd *RetryDecorator) XGroupDestroy(key, group string) (int64, error)

func (*RetryDecorator) XGroupSetID

func (rd *RetryDecorator) XGroupSetID(key, group, id string) error

func (*RetryDecorator) XInfoConsumers

func (rd *RetryDecorator) XInfoConsumers(key, group string) ([]models.StreamConsumer, error)

func (*RetryDecorator) XInfoGroups

func (rd *RetryDecorator) XInfoGroups(key string) ([]models.StreamGroup, error)

func (*RetryDecorator) XInfoStream

func (rd *RetryDecorator) XInfoStream(key string) (*models.StreamInfo, error)

func (*RetryDecorator) XLEN

func (rd *RetryDecorator) XLEN(key string) int64

func (*RetryDecorator) XPENDING

func (rd *RetryDecorator) XPENDING(key, group string) (int64, error)

func (*RetryDecorator) XRANGE

func (rd *RetryDecorator) XRANGE(key, start, end string, count int) ([]models.StreamEntry, error)

func (*RetryDecorator) XREAD

func (rd *RetryDecorator) XREAD(keys []string, ids []string, count int) (map[string][]models.StreamEntry, error)

func (*RetryDecorator) XREVRANGE

func (rd *RetryDecorator) XREVRANGE(key, start, end string, count int) ([]models.StreamEntry, error)

func (*RetryDecorator) XSETID

func (rd *RetryDecorator) XSETID(key string, id string) error

func (*RetryDecorator) XTRIM

func (rd *RetryDecorator) XTRIM(key string, strategy string, threshold int64) (int64, error)

func (*RetryDecorator) ZAdd

func (rd *RetryDecorator) ZAdd(key string, score float64, member string) error

func (*RetryDecorator) ZCard

func (rd *RetryDecorator) ZCard(key string) int

func (*RetryDecorator) ZCount

func (rd *RetryDecorator) ZCount(key string, min, max float64) int

func (*RetryDecorator) ZDiff

func (rd *RetryDecorator) ZDiff(keys ...string) []string

func (*RetryDecorator) ZDiffStore

func (rd *RetryDecorator) ZDiffStore(destination string, keys ...string) (int, error)

func (*RetryDecorator) ZIncrBy

func (rd *RetryDecorator) ZIncrBy(key string, increment float64, member string) (float64, error)

func (*RetryDecorator) ZInter

func (rd *RetryDecorator) ZInter(keys ...string) []string

func (*RetryDecorator) ZInterCard

func (rd *RetryDecorator) ZInterCard(keys ...string) (int, error)

func (*RetryDecorator) ZInterStore

func (rd *RetryDecorator) ZInterStore(destination string, keys []string, weights []float64) (int, error)

func (*RetryDecorator) ZLexCount

func (rd *RetryDecorator) ZLexCount(key, min, max string) (int, error)

func (*RetryDecorator) ZRange

func (rd *RetryDecorator) ZRange(key string, start, stop int) []string

func (*RetryDecorator) ZRangeByLex

func (rd *RetryDecorator) ZRangeByLex(key string, min, max string) []string

func (*RetryDecorator) ZRangeByScore

func (rd *RetryDecorator) ZRangeByScore(key string, min, max float64) []string

func (*RetryDecorator) ZRangeByScoreWithScores

func (rd *RetryDecorator) ZRangeByScoreWithScores(key string, min, max float64) []models.ZSetMember

func (*RetryDecorator) ZRangeStore

func (rd *RetryDecorator) ZRangeStore(destination string, source string, start, stop int, withScores bool) (int, error)

func (*RetryDecorator) ZRangeWithScores

func (rd *RetryDecorator) ZRangeWithScores(key string, start, stop int) []models.ZSetMember

func (*RetryDecorator) ZRank

func (rd *RetryDecorator) ZRank(key string, member string) (int, bool)

func (*RetryDecorator) ZRem

func (rd *RetryDecorator) ZRem(key string, member string) error

func (*RetryDecorator) ZRemRangeByLex

func (rd *RetryDecorator) ZRemRangeByLex(key string, min, max string) (int, error)

func (*RetryDecorator) ZRemRangeByRank

func (rd *RetryDecorator) ZRemRangeByRank(key string, start, stop int) (int, error)

func (*RetryDecorator) ZRemRangeByScore

func (rd *RetryDecorator) ZRemRangeByScore(key string, min, max float64) (int, error)

func (*RetryDecorator) ZRevRange

func (rd *RetryDecorator) ZRevRange(key string, start, stop int) []string

func (*RetryDecorator) ZRevRangeByLex

func (rd *RetryDecorator) ZRevRangeByLex(key string, max, min string) []string

func (*RetryDecorator) ZRevRangeByScore

func (rd *RetryDecorator) ZRevRangeByScore(key string, max, min float64) []string

func (*RetryDecorator) ZRevRangeWithScores

func (rd *RetryDecorator) ZRevRangeWithScores(key string, start, stop int) []models.ZSetMember

func (*RetryDecorator) ZRevRank

func (rd *RetryDecorator) ZRevRank(key string, member string) (int, bool)

func (*RetryDecorator) ZScan

func (rd *RetryDecorator) ZScan(key string, cursor int, match string, count int) ([]models.ZSetMember, int)

func (*RetryDecorator) ZScore

func (rd *RetryDecorator) ZScore(key string, member string) (float64, bool)

func (*RetryDecorator) ZUnion

func (rd *RetryDecorator) ZUnion(keys ...string) []models.ZSetMember

func (*RetryDecorator) ZUnionStore

func (rd *RetryDecorator) ZUnionStore(destination string, keys []string, weights []float64) (int, error)

type Stats

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

func NewStats

func NewStats() *Stats

func (*Stats) GetStats

func (s *Stats) GetStats() map[string]int64

func (*Stats) IncrEvictedKeys

func (s *Stats) IncrEvictedKeys()

func (*Stats) IncrExpiredKeys

func (s *Stats) IncrExpiredKeys()

func (*Stats) IncrHits

func (s *Stats) IncrHits()

func (*Stats) IncrMisses

func (s *Stats) IncrMisses()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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