Documentation ¶
Index ¶
- func WithCacheLimit(cacheLimit int) option.Option[RBTreePriorityCache]
- func WithDefaultPriority(priority int) option.Option[RBTreePriorityCache]
- type Priority
- type RBTreePriorityCache
- func (r *RBTreePriorityCache) DecrBy(ctx context.Context, key string, value int64) (int64, error)
- func (r *RBTreePriorityCache) Delete(ctx context.Context, keys ...string) (int64, error)
- func (r *RBTreePriorityCache) Get(ctx context.Context, key string) (val ecache.Value)
- func (r *RBTreePriorityCache) GetSet(ctx context.Context, key string, val string) ecache.Value
- func (r *RBTreePriorityCache) IncrBy(ctx context.Context, key string, value int64) (int64, error)
- func (r *RBTreePriorityCache) IncrByFloat(ctx context.Context, key string, value float64) (float64, error)
- func (r *RBTreePriorityCache) LPop(ctx context.Context, key string) ecache.Value
- func (r *RBTreePriorityCache) LPush(ctx context.Context, key string, val ...any) (int64, error)
- func (r *RBTreePriorityCache) SAdd(ctx context.Context, key string, members ...any) (int64, error)
- func (r *RBTreePriorityCache) SRem(_ context.Context, key string, members ...any) (int64, error)
- func (r *RBTreePriorityCache) Set(_ context.Context, key string, val any, expiration time.Duration) error
- func (r *RBTreePriorityCache) SetNX(ctx context.Context, key string, val any, expiration time.Duration) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCacheLimit ¶
func WithCacheLimit(cacheLimit int) option.Option[RBTreePriorityCache]
WithCacheLimit 设置所允许的最大键值对数量
func WithDefaultPriority ¶
func WithDefaultPriority(priority int) option.Option[RBTreePriorityCache]
Types ¶
type Priority ¶
type Priority interface { // Priority 获取元素的优先级 Priority() int }
Priority 如果传进来的元素没有实现该接口,则默认优先级为0
type RBTreePriorityCache ¶
type RBTreePriorityCache struct {
// contains filtered or unexported fields
}
func NewRBTreePriorityCache ¶
func NewRBTreePriorityCache(opts ...option.Option[RBTreePriorityCache]) (*RBTreePriorityCache, error)
func (*RBTreePriorityCache) IncrByFloat ¶
Click to show internal directories.
Click to hide internal directories.