priority

package
v0.0.0-...-7567983 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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) DecrBy

func (r *RBTreePriorityCache) DecrBy(ctx context.Context, key string, value int64) (int64, error)

func (*RBTreePriorityCache) Delete

func (r *RBTreePriorityCache) Delete(ctx context.Context, keys ...string) (int64, error)

func (*RBTreePriorityCache) Get

func (r *RBTreePriorityCache) Get(ctx context.Context, key string) (val ecache.Value)

func (*RBTreePriorityCache) GetSet

func (r *RBTreePriorityCache) GetSet(ctx context.Context, key string, val string) ecache.Value

func (*RBTreePriorityCache) IncrBy

func (r *RBTreePriorityCache) IncrBy(ctx context.Context, key string, value int64) (int64, error)

func (*RBTreePriorityCache) IncrByFloat

func (r *RBTreePriorityCache) IncrByFloat(ctx context.Context, key string, value float64) (float64, error)

func (*RBTreePriorityCache) LPop

func (*RBTreePriorityCache) LPush

func (r *RBTreePriorityCache) LPush(ctx context.Context, key string, val ...any) (int64, error)

func (*RBTreePriorityCache) SAdd

func (r *RBTreePriorityCache) SAdd(ctx context.Context, key string, members ...any) (int64, error)

func (*RBTreePriorityCache) SRem

func (r *RBTreePriorityCache) SRem(_ context.Context, key string, members ...any) (int64, error)

func (*RBTreePriorityCache) Set

func (r *RBTreePriorityCache) Set(_ context.Context, key string, val any, expiration time.Duration) error

func (*RBTreePriorityCache) SetNX

func (r *RBTreePriorityCache) SetNX(ctx context.Context, key string, val any, expiration time.Duration) (bool, error)

Jump to

Keyboard shortcuts

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