Versions in this module Expand all Collapse all v2 v2.1.0 Jul 27, 2022 Changes in this version + var Defaultopt = Options + func CountItemPipe(pipe redis.Pipeliner, ctx context.Context, key string, item string) (*redisbloomhelper.OneInt64MapPlacehold, error) + func IncrItemPipe(pipe redis.Pipeliner, ctx context.Context, key string, item string, ...) (*redisbloomhelper.StringListValPlacehold, error) + func IncrWithIncrItems(incritems ...*redisbloomhelper.IncrItem) optparams.Option[IncrOpts] + func IncrWithIncrement(n int64) optparams.Option[IncrOpts] + func IncrWithItemMap(itemmap map[string]int64) optparams.Option[IncrOpts] + func IncrWithItems(items ...string) optparams.Option[IncrOpts] + func IncrWithRefreshTTL() optparams.Option[IncrOpts] + func IncrWithTTL(t time.Duration) optparams.Option[IncrOpts] + func InitPipe(pipe redis.Pipeliner, ctx context.Context, key string, topk int64, ...) *redis.Cmd + func InitWithDecay(decay float64) optparams.Option[InitOpts] + func InitWithDepth(depth int64) optparams.Option[InitOpts] + func InitWithRefreshTTL() optparams.Option[InitOpts] + func InitWithTTL(t time.Duration) optparams.Option[InitOpts] + func InitWithWidth(width int64) optparams.Option[InitOpts] + func ListPipe(pipe redis.Pipeliner, ctx context.Context, key string) *redisbloomhelper.StringListValPlacehold + func MCountItemPipe(pipe redis.Pipeliner, ctx context.Context, key string, items ...string) (*redisbloomhelper.Int64MapPlacehold, error) + func MIncrItemPipe(pipe redis.Pipeliner, ctx context.Context, key string, ...) (*redisbloomhelper.StringListValPlacehold, error) + func MQueryItemPipe(pipe redis.Pipeliner, ctx context.Context, key string, items ...string) (*redisbloomhelper.BoolMapPlacehold, error) + func QueryItemPipe(pipe redis.Pipeliner, ctx context.Context, key string, item string) (*redisbloomhelper.OneBoolMapPlacehold, error) + func WithAutoRefreshInterval(autoRefreshInterval string) optparams.Option[Options] + func WithInit(topk int64, opts ...optparams.Option[InitOpts]) optparams.Option[Options] + func WithKey(key string) optparams.Option[Options] + func WithMaxTTL(maxTTL time.Duration) optparams.Option[Options] + func WithMiddlewaretype(typename string) optparams.Option[Options] + func WithNamespace(ns ...string) optparams.Option[Options] + func WithSpecifiedKey(key string) optparams.Option[Options] + func WithTaskCron(taskCron *cron.Cron) optparams.Option[Options] + type CountItem struct + Count int64 + Item string + type CountItemPlacehold struct + Ck string + Cmd *redis.Cmd + func ListWithCountPipe(pipe redis.Pipeliner, ctx context.Context, key string) *CountItemPlacehold + func (r *CountItemPlacehold) Result() ([]*CountItem, error) + type IncrOpts struct + Increment int64 + MincrIncrement []int64 + MincrItems []string + RefreshOpts []optparams.Option[middlewarehelper.RefreshOpt] + type InfoPlacehold struct + Ck string + Cmd *redis.Cmd + func InfoPipe(pipe redis.Pipeliner, ctx context.Context, key string) *InfoPlacehold + func (r *InfoPlacehold) Result() (*TopKInfo, error) + type InitOpts struct + Decay float64 + Depth int64 + RefreshOpts []optparams.Option[middlewarehelper.RefreshOpt] + Width int64 + type Options struct + InitOpts []optparams.Option[InitOpts] + InitTopK int64 + MiddlewareOpts []optparams.Option[middlewarehelper.Options] + Middlewaretype string + type TopK struct + func New(cli redis.UniversalClient, opts ...optparams.Option[Options]) (*TopK, error) + func (c *TopK) Clean(ctx context.Context) error + func (c *TopK) CountItem(ctx context.Context, item string) (int64, error) + func (c *TopK) IncrItem(ctx context.Context, item string, opts ...optparams.Option[IncrOpts]) ([]string, error) + func (c *TopK) Info(ctx context.Context) (*TopKInfo, error) + func (c *TopK) Init(ctx context.Context, topk int64, opts ...optparams.Option[InitOpts]) error + func (c *TopK) List(ctx context.Context) ([]string, error) + func (c *TopK) ListWithCount(ctx context.Context) ([]*CountItem, error) + func (c *TopK) MCountItem(ctx context.Context, items ...string) (map[string]int64, error) + func (c *TopK) MIncrItem(ctx context.Context, opts ...optparams.Option[IncrOpts]) ([]string, error) + func (c *TopK) MQueryItem(ctx context.Context, items ...string) (map[string]bool, error) + func (c *TopK) QueryItem(ctx context.Context, item string) (bool, error) + type TopKInfo struct + Decay float64 + Depth int64 + K int64 + Width int64