Documentation ¶
Index ¶
- type BatchResult
- type ListOp
- type ListOpResult
- type MemoryAnalytics
- type MemoryCache
- func (c *MemoryCache) AddToTransaction(cmd models.Command) error
- func (c *MemoryCache) BatchKeys(patterns []string) map[string][]string
- func (c *MemoryCache) BatchLRange(ranges map[string][2]int) map[string][]string
- func (c *MemoryCache) BatchOp(ops []struct{ ... }) []BatchResult
- func (c *MemoryCache) BatchTTL(keys []string) map[string]int
- func (c *MemoryCache) BitCount(key string, start, end int64) (int64, error)
- func (c *MemoryCache) BitField(key string, commands []models.BitFieldCommand) ([]int64, error)
- func (c *MemoryCache) BitFieldRO(key string, commands []models.BitFieldCommand) ([]int64, error)
- func (c *MemoryCache) BitOp(operation string, destkey string, keys ...string) (int64, error)
- func (c *MemoryCache) BitPos(key string, bit int, start, end int64, reverse bool) (int64, error)
- func (c *MemoryCache) DBSize() int
- func (c *MemoryCache) Defragment()
- func (c *MemoryCache) Del(key string) (bool, error)
- func (c *MemoryCache) DeleteJSON(key string) bool
- func (c *MemoryCache) Discard() error
- func (c *MemoryCache) Exec() ([]models.Value, error)
- func (c *MemoryCache) ExecPipeline(pl *models.Pipeline) []models.Value
- func (c *MemoryCache) Exists(key string) bool
- func (c *MemoryCache) Expire(key string, seconds int) error
- func (c *MemoryCache) ExpireAt(key string, timestamp int64) error
- func (c *MemoryCache) ExpireTime(key string) (int64, error)
- func (c *MemoryCache) FlushAll()
- func (c *MemoryCache) Get(key string) (string, bool)
- func (c *MemoryCache) GetBit(key string, offset int64) (int, error)
- func (c *MemoryCache) GetBloomFilterStats() models.BloomFilterStats
- func (c *MemoryCache) GetDefragStats() map[string]interface{}
- func (c *MemoryCache) GetJSON(key string) (interface{}, bool)
- func (c *MemoryCache) GetKeyVersion(key string) int64
- func (c *MemoryCache) GetMemoryAnalytics() *MemoryAnalytics
- func (c *MemoryCache) GetMemoryStats() models.MemoryStats
- func (c *MemoryCache) HDel(hash string, field string) (bool, error)
- func (c *MemoryCache) HGet(hash string, key string) (string, bool)
- func (c *MemoryCache) HGetAll(hash string) map[string]string
- func (c *MemoryCache) HIncrBy(key, field string, increment int64) (int64, error)
- func (c *MemoryCache) HIncrByFloat(key, field string, increment float64) (float64, error)
- func (c *MemoryCache) HScan(hash string, cursor int, matchPattern string, count int) ([]string, int)
- func (c *MemoryCache) HSet(hash string, key string, value string) error
- func (c *MemoryCache) Incr(key string) (int, error)
- func (c *MemoryCache) IncrCommandCount()
- func (c *MemoryCache) Info() map[string]string
- func (c *MemoryCache) IsInTransaction() bool
- func (c *MemoryCache) Keys(matchPattern string) []string
- func (c *MemoryCache) LIndex(key string, index int) (string, bool)
- func (c *MemoryCache) LInsert(key string, before bool, pivot string, value string) (int, error)
- func (c *MemoryCache) LLen(key string) int
- func (c *MemoryCache) LPop(key string) (string, bool)
- func (c *MemoryCache) LPos(key string, element string) (int, bool)
- func (c *MemoryCache) LPush(key string, value string) (int, error)
- func (c *MemoryCache) LPushX(key string, value string) (int, error)
- func (c *MemoryCache) LRange(key string, start, stop int) ([]string, error)
- func (c *MemoryCache) LRem(key string, count int, value string) (int, error)
- func (c *MemoryCache) LSet(key string, index int, value string) error
- func (c *MemoryCache) LTrim(key string, start int, stop int) error
- func (c *MemoryCache) Multi() error
- func (c *MemoryCache) PFAdd(key string, elements ...string) (bool, error)
- func (c *MemoryCache) PFCount(keys ...string) (int64, error)
- func (c *MemoryCache) PFMerge(destKey string, sourceKeys ...string) error
- func (c *MemoryCache) Pipeline() *models.Pipeline
- func (c *MemoryCache) RPop(key string) (string, bool)
- func (c *MemoryCache) RPush(key string, value string) (int, error)
- func (c *MemoryCache) RPushX(key string, value string) (int, error)
- func (c *MemoryCache) Rename(oldKey, newKey string) error
- func (c *MemoryCache) SAdd(key string, member string) (bool, error)
- func (c *MemoryCache) SCard(key string) int
- func (c *MemoryCache) SDiff(keys ...string) []string
- func (c *MemoryCache) SInter(keys ...string) []string
- func (c *MemoryCache) SIsMember(key string, member string) bool
- func (c *MemoryCache) SMembers(key string) ([]string, error)
- func (c *MemoryCache) SRem(key string, member string) (bool, error)
- func (c *MemoryCache) SUnion(keys ...string) []string
- func (c *MemoryCache) Scan(cursor int, matchPattern string, count int) ([]string, int)
- func (c *MemoryCache) Set(key string, value string) error
- func (c *MemoryCache) SetBit(key string, offset int64, value int) (int, error)
- func (c *MemoryCache) SetJSON(key string, value interface{}) error
- func (c *MemoryCache) SetMemoryLimit(maxBytes int64)
- func (c *MemoryCache) StartDefragmentation(interval time.Duration, threshold float64)
- func (c *MemoryCache) StartMemoryMonitor(interval time.Duration)
- func (c *MemoryCache) TTL(key string) int
- func (c *MemoryCache) Type(key string) string
- func (c *MemoryCache) Unwatch() error
- func (c *MemoryCache) Watch(keys ...string) error
- func (c *MemoryCache) WithRetry(strategy models.RetryStrategy) ports.Cache
- func (c *MemoryCache) XACK(key, group string, ids ...string) (int64, error)
- func (c *MemoryCache) XAdd(key string, id string, fields map[string]string) error
- func (c *MemoryCache) XAutoClaim(key, group, consumer string, minIdleTime int64, start string, count int) ([]string, []models.StreamEntry, string, error)
- func (c *MemoryCache) XClaim(key, group, consumer string, minIdleTime int64, ids ...string) ([]models.StreamEntry, error)
- func (c *MemoryCache) XDEL(key string, ids ...string) (int64, error)
- func (c *MemoryCache) XGroupCreate(key, group, id string) error
- func (c *MemoryCache) XGroupCreateConsumer(key, group, consumer string) (int64, error)
- func (c *MemoryCache) XGroupDelConsumer(key, group, consumer string) (int64, error)
- func (c *MemoryCache) XGroupDestroy(key, group string) (int64, error)
- func (c *MemoryCache) XGroupSetID(key, group, id string) error
- func (c *MemoryCache) XInfoConsumers(key, group string) ([]models.StreamConsumer, error)
- func (c *MemoryCache) XInfoGroups(key string) ([]models.StreamGroup, error)
- func (c *MemoryCache) XInfoStream(key string) (*models.StreamInfo, error)
- func (c *MemoryCache) XLEN(key string) int64
- func (c *MemoryCache) XPENDING(key, group string) (int64, error)
- func (c *MemoryCache) XRANGE(key, start, end string, count int) ([]models.StreamEntry, error)
- func (c *MemoryCache) XREAD(keys []string, ids []string, count int) (map[string][]models.StreamEntry, error)
- func (c *MemoryCache) XREVRANGE(key, start, end string, count int) ([]models.StreamEntry, error)
- func (c *MemoryCache) XSETID(key string, id string) error
- func (c *MemoryCache) XTRIM(key string, strategy string, threshold int64) (int64, error)
- func (c *MemoryCache) ZAdd(key string, score float64, member string) error
- func (c *MemoryCache) ZCard(key string) int
- func (c *MemoryCache) ZCount(key string, min, max float64) int
- func (c *MemoryCache) ZDiff(keys ...string) []string
- func (c *MemoryCache) ZDiffStore(destination string, keys ...string) (int, error)
- func (c *MemoryCache) ZIncrBy(key string, increment float64, member string) (float64, error)
- func (c *MemoryCache) ZInter(keys ...string) []string
- func (c *MemoryCache) ZInterCard(keys ...string) (int, error)
- func (c *MemoryCache) ZInterStore(destination string, keys []string, weights []float64) (int, error)
- func (c *MemoryCache) ZLexCount(key string, min, max string) (int, error)
- func (c *MemoryCache) ZPopMax(key string) (models.ZSetMember, bool)
- func (c *MemoryCache) ZPopMaxN(key string, count int) []models.ZSetMember
- func (c *MemoryCache) ZPopMin(key string) (models.ZSetMember, bool)
- func (c *MemoryCache) ZPopMinN(key string, count int) []models.ZSetMember
- func (c *MemoryCache) ZRandMember(key string, count int, withScores bool) []models.ZSetMember
- func (c *MemoryCache) ZRandMemberWithoutScores(key string, count int) []string
- func (c *MemoryCache) ZRange(key string, start, stop int) []string
- func (c *MemoryCache) ZRangeByLex(key string, min, max string) []string
- func (c *MemoryCache) ZRangeByScore(key string, min, max float64) []string
- func (c *MemoryCache) ZRangeByScoreWithScores(key string, min, max float64) []models.ZSetMember
- func (c *MemoryCache) ZRangeStore(destination string, source string, start, stop int, withScores bool) (int, error)
- func (c *MemoryCache) ZRangeWithScores(key string, start, stop int) []models.ZSetMember
- func (c *MemoryCache) ZRank(key string, member string) (int, bool)
- func (c *MemoryCache) ZRem(key string, member string) error
- func (c *MemoryCache) ZRemRangeByLex(key string, min, max string) (int, error)
- func (c *MemoryCache) ZRemRangeByRank(key string, start, stop int) (int, error)
- func (c *MemoryCache) ZRemRangeByScore(key string, min, max float64) (int, error)
- func (c *MemoryCache) ZRevRange(key string, start, stop int) []string
- func (c *MemoryCache) ZRevRangeByLex(key string, max, min string) []string
- func (c *MemoryCache) ZRevRangeByScore(key string, max, min float64) []string
- func (c *MemoryCache) ZRevRangeWithScores(key string, start, stop int) []models.ZSetMember
- func (c *MemoryCache) ZRevRank(key string, member string) (int, bool)
- func (c *MemoryCache) ZScan(key string, cursor int, match string, count int) ([]models.ZSetMember, int)
- func (c *MemoryCache) ZScore(key string, member string) (float64, bool)
- func (c *MemoryCache) ZUnion(keys ...string) []models.ZSetMember
- func (c *MemoryCache) ZUnionStore(destination string, keys []string, weights []float64) (int, error)
- type RetryDecorator
- func (rd *RetryDecorator) AddToTransaction(cmd models.Command) error
- func (rd *RetryDecorator) BitCount(key string, start, end int64) (int64, error)
- func (rd *RetryDecorator) BitField(key string, commands []models.BitFieldCommand) ([]int64, error)
- func (rd *RetryDecorator) BitFieldRO(key string, commands []models.BitFieldCommand) ([]int64, error)
- func (rd *RetryDecorator) BitOp(operation string, destkey string, keys ...string) (int64, error)
- func (rd *RetryDecorator) BitPos(key string, bit int, start, end int64, reverse bool) (int64, error)
- func (rd *RetryDecorator) DBSize() int
- func (rd *RetryDecorator) Defragment()
- func (rd *RetryDecorator) Del(key string) (bool, error)
- func (rd *RetryDecorator) DeleteJSON(key string) bool
- func (rd *RetryDecorator) Discard() error
- func (rd *RetryDecorator) Exec() ([]models.Value, error)
- func (rd *RetryDecorator) ExecPipeline(pipeline *models.Pipeline) []models.Value
- func (rd *RetryDecorator) Exists(key string) bool
- func (rd *RetryDecorator) Expire(key string, seconds int) error
- func (rd *RetryDecorator) ExpireAt(key string, timestamp int64) error
- func (rd *RetryDecorator) ExpireTime(key string) (int64, error)
- func (rd *RetryDecorator) FlushAll()
- func (rd *RetryDecorator) Get(key string) (string, bool)
- func (rd *RetryDecorator) GetBit(key string, offset int64) (int, error)
- func (rd *RetryDecorator) GetJSON(key string) (interface{}, bool)
- func (rd *RetryDecorator) GetKeyVersion(key string) int64
- func (rd *RetryDecorator) GetMemoryStats() models.MemoryStats
- func (rd *RetryDecorator) HDel(hash string, field string) (bool, error)
- func (rd *RetryDecorator) HGet(hash string, key string) (string, bool)
- func (rd *RetryDecorator) HGetAll(hash string) map[string]string
- func (rd *RetryDecorator) HIncrBy(key, field string, increment int64) (int64, error)
- func (rd *RetryDecorator) HIncrByFloat(key, field string, increment float64) (float64, error)
- func (rd *RetryDecorator) HScan(hash string, cursor int, pattern string, count int) ([]string, int)
- func (rd *RetryDecorator) HSet(hash string, key string, value string) error
- func (rd *RetryDecorator) Incr(key string) (int, error)
- func (rd *RetryDecorator) IncrCommandCount()
- func (rd *RetryDecorator) Info() map[string]string
- func (rd *RetryDecorator) IsInTransaction() bool
- func (rd *RetryDecorator) Keys(pattern string) []string
- func (rd *RetryDecorator) LIndex(key string, index int) (string, bool)
- func (rd *RetryDecorator) LInsert(key string, before bool, pivot string, value string) (int, error)
- func (rd *RetryDecorator) LLen(key string) int
- func (rd *RetryDecorator) LPop(key string) (string, bool)
- func (rd *RetryDecorator) LPos(key string, element string) (int, bool)
- func (rd *RetryDecorator) LPush(key string, value string) (int, error)
- func (rd *RetryDecorator) LPushX(key string, value string) (int, error)
- func (rd *RetryDecorator) LRange(key string, start, stop int) ([]string, error)
- func (rd *RetryDecorator) LRem(key string, count int, value string) (int, error)
- func (rd *RetryDecorator) LSet(key string, index int, value string) error
- func (rd *RetryDecorator) LTrim(key string, start int, stop int) error
- func (rd *RetryDecorator) Multi() error
- func (rd *RetryDecorator) PFAdd(key string, elements ...string) (bool, error)
- func (rd *RetryDecorator) PFCount(keys ...string) (int64, error)
- func (rd *RetryDecorator) PFMerge(destKey string, sourceKeys ...string) error
- func (rd *RetryDecorator) Pipeline() *models.Pipeline
- func (rd *RetryDecorator) RPop(key string) (string, bool)
- func (rd *RetryDecorator) RPush(key string, value string) (int, error)
- func (rd *RetryDecorator) RPushX(key string, value string) (int, error)
- func (rd *RetryDecorator) Rename(oldKey, newKey string) error
- func (rd *RetryDecorator) SAdd(key string, member string) (bool, error)
- func (rd *RetryDecorator) SCard(key string) int
- func (rd *RetryDecorator) SDiff(keys ...string) []string
- func (rd *RetryDecorator) SInter(keys ...string) []string
- func (rd *RetryDecorator) SIsMember(key string, member string) bool
- func (rd *RetryDecorator) SMembers(key string) ([]string, error)
- func (rd *RetryDecorator) SRem(key string, member string) (bool, error)
- func (rd *RetryDecorator) SUnion(keys ...string) []string
- func (rd *RetryDecorator) Scan(cursor int, pattern string, count int) ([]string, int)
- func (rd *RetryDecorator) Set(key string, value string) error
- func (rd *RetryDecorator) SetBit(key string, offset int64, value int) (int, error)
- func (rd *RetryDecorator) SetJSON(key string, value interface{}) error
- func (rd *RetryDecorator) StartDefragmentation(interval time.Duration, threshold float64)
- func (rd *RetryDecorator) TTL(key string) int
- func (rd *RetryDecorator) Type(key string) string
- func (rd *RetryDecorator) Unwatch() error
- func (rd *RetryDecorator) Watch(keys ...string) error
- func (rd *RetryDecorator) WithRetry(strategy models.RetryStrategy) ports.Cache
- func (rd *RetryDecorator) XACK(key, group string, ids ...string) (int64, error)
- func (rd *RetryDecorator) XAdd(key string, id string, fields map[string]string) error
- func (rd *RetryDecorator) XAutoClaim(key, group, consumer string, minIdleTime int64, start string, count int) ([]string, []models.StreamEntry, string, error)
- func (rd *RetryDecorator) XClaim(key, group, consumer string, minIdleTime int64, ids ...string) ([]models.StreamEntry, error)
- func (rd *RetryDecorator) XDEL(key string, ids ...string) (int64, error)
- func (rd *RetryDecorator) XGroupCreate(key, group, id string) error
- func (rd *RetryDecorator) XGroupCreateConsumer(key, group, consumer string) (int64, error)
- func (rd *RetryDecorator) XGroupDelConsumer(key, group, consumer string) (int64, error)
- func (rd *RetryDecorator) XGroupDestroy(key, group string) (int64, error)
- func (rd *RetryDecorator) XGroupSetID(key, group, id string) error
- func (rd *RetryDecorator) XInfoConsumers(key, group string) ([]models.StreamConsumer, error)
- func (rd *RetryDecorator) XInfoGroups(key string) ([]models.StreamGroup, error)
- func (rd *RetryDecorator) XInfoStream(key string) (*models.StreamInfo, error)
- func (rd *RetryDecorator) XLEN(key string) int64
- func (rd *RetryDecorator) XPENDING(key, group string) (int64, error)
- func (rd *RetryDecorator) XRANGE(key, start, end string, count int) ([]models.StreamEntry, error)
- func (rd *RetryDecorator) XREAD(keys []string, ids []string, count int) (map[string][]models.StreamEntry, error)
- func (rd *RetryDecorator) XREVRANGE(key, start, end string, count int) ([]models.StreamEntry, error)
- func (rd *RetryDecorator) XSETID(key string, id string) error
- func (rd *RetryDecorator) XTRIM(key string, strategy string, threshold int64) (int64, error)
- func (rd *RetryDecorator) ZAdd(key string, score float64, member string) error
- func (rd *RetryDecorator) ZCard(key string) int
- func (rd *RetryDecorator) ZCount(key string, min, max float64) int
- func (rd *RetryDecorator) ZDiff(keys ...string) []string
- func (rd *RetryDecorator) ZDiffStore(destination string, keys ...string) (int, error)
- func (rd *RetryDecorator) ZIncrBy(key string, increment float64, member string) (float64, error)
- func (rd *RetryDecorator) ZInter(keys ...string) []string
- func (rd *RetryDecorator) ZInterCard(keys ...string) (int, error)
- func (rd *RetryDecorator) ZInterStore(destination string, keys []string, weights []float64) (int, error)
- func (rd *RetryDecorator) ZLexCount(key, min, max string) (int, error)
- func (rd *RetryDecorator) ZRange(key string, start, stop int) []string
- func (rd *RetryDecorator) ZRangeByLex(key string, min, max string) []string
- func (rd *RetryDecorator) ZRangeByScore(key string, min, max float64) []string
- func (rd *RetryDecorator) ZRangeByScoreWithScores(key string, min, max float64) []models.ZSetMember
- func (rd *RetryDecorator) ZRangeStore(destination string, source string, start, stop int, withScores bool) (int, error)
- func (rd *RetryDecorator) ZRangeWithScores(key string, start, stop int) []models.ZSetMember
- func (rd *RetryDecorator) ZRank(key string, member string) (int, bool)
- func (rd *RetryDecorator) ZRem(key string, member string) error
- func (rd *RetryDecorator) ZRemRangeByLex(key string, min, max string) (int, error)
- func (rd *RetryDecorator) ZRemRangeByRank(key string, start, stop int) (int, error)
- func (rd *RetryDecorator) ZRemRangeByScore(key string, min, max float64) (int, error)
- func (rd *RetryDecorator) ZRevRange(key string, start, stop int) []string
- func (rd *RetryDecorator) ZRevRangeByLex(key string, max, min string) []string
- func (rd *RetryDecorator) ZRevRangeByScore(key string, max, min float64) []string
- func (rd *RetryDecorator) ZRevRangeWithScores(key string, start, stop int) []models.ZSetMember
- func (rd *RetryDecorator) ZRevRank(key string, member string) (int, bool)
- func (rd *RetryDecorator) ZScan(key string, cursor int, match string, count int) ([]models.ZSetMember, int)
- func (rd *RetryDecorator) ZScore(key string, member string) (float64, bool)
- func (rd *RetryDecorator) ZUnion(keys ...string) []models.ZSetMember
- func (rd *RetryDecorator) ZUnionStore(destination string, keys []string, weights []float64) (int, error)
- type Stats
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 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) 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) DeleteJSON ¶
func (c *MemoryCache) DeleteJSON(key string) bool
func (*MemoryCache) Discard ¶
func (c *MemoryCache) Discard() 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) 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) 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) 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) 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) 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) 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) 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) PFMerge ¶
func (c *MemoryCache) PFMerge(destKey string, sourceKeys ...string) error
func (*MemoryCache) Pipeline ¶
func (c *MemoryCache) Pipeline() *models.Pipeline
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) 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) SMembers ¶
func (c *MemoryCache) SMembers(key string) ([]string, error)
Set Operations
func (*MemoryCache) SUnion ¶
func (c *MemoryCache) SUnion(keys ...string) []string
func (*MemoryCache) Scan ¶
Scan implements Redis SCAN command with optimized iteration over all key types
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) 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) 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) 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) 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) ZDiff ¶
func (c *MemoryCache) ZDiff(keys ...string) []string
func (*MemoryCache) ZDiffStore ¶
func (c *MemoryCache) ZDiffStore(destination string, keys ...string) (int, error)
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 (*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 (*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) 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 ¶
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) DBSize ¶
func (rd *RetryDecorator) DBSize() int
func (*RetryDecorator) Defragment ¶
func (rd *RetryDecorator) Defragment()
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) ExecPipeline ¶
func (rd *RetryDecorator) ExecPipeline(pipeline *models.Pipeline) []models.Value
func (*RetryDecorator) Exists ¶
func (rd *RetryDecorator) Exists(key string) bool
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) 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) 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) HSet ¶
func (rd *RetryDecorator) HSet(hash string, key string, value string) 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 ¶
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) 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) 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) PFMerge ¶
func (rd *RetryDecorator) PFMerge(destKey string, sourceKeys ...string) error
func (*RetryDecorator) Pipeline ¶
func (rd *RetryDecorator) Pipeline() *models.Pipeline
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) SRem ¶
func (rd *RetryDecorator) SRem(key string, member string) (bool, error)
func (*RetryDecorator) SUnion ¶
func (rd *RetryDecorator) SUnion(keys ...string) []string
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) 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) ZAdd ¶
func (rd *RetryDecorator) ZAdd(key string, score float64, member string) error
func (*RetryDecorator) ZCard ¶
func (rd *RetryDecorator) ZCard(key string) 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) ZInter ¶
func (rd *RetryDecorator) ZInter(keys ...string) []string
func (*RetryDecorator) ZInterCard ¶
func (rd *RetryDecorator) ZInterCard(keys ...string) (int, error)
func (*RetryDecorator) ZInterStore ¶
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 (*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) 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 ¶
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
func (*Stats) IncrEvictedKeys ¶
func (s *Stats) IncrEvictedKeys()
func (*Stats) IncrExpiredKeys ¶
func (s *Stats) IncrExpiredKeys()
func (*Stats) IncrMisses ¶
func (s *Stats) IncrMisses()