Versions in this module Expand all Collapse all v2 v2.1.0 Jul 27, 2022 Changes in this version + var Defaultopt = Options + func RefreshTTL() optparams.Option[ClThrottleOpts] + func RefreshTTLAtFirstTime() optparams.Option[ClThrottleOpts] + func WithAutoRefreshInterval(autoRefreshInterval string) optparams.Option[Options] + func WithCountPerPeriod(countPerPeriod int64) optparams.Option[ClThrottleOpts] + func WithDefaultCountPerPeriod(countPerPeriod int64) optparams.Option[Options] + func WithDefaultMaxBurst(maxBurst int64) optparams.Option[Options] + func WithDefaultPeriod(period int64) optparams.Option[Options] + func WithKey(key string) optparams.Option[Options] + func WithMaxBurst(maxBurst int64) optparams.Option[ClThrottleOpts] + func WithMaxTTL(maxTTL time.Duration) optparams.Option[Options] + func WithMiddlewaretype(typename string) optparams.Option[Options] + func WithNamespace(ns ...string) optparams.Option[Options] + func WithPeriod(period int64) optparams.Option[ClThrottleOpts] + func WithSpecifiedKey(key string) optparams.Option[Options] + func WithTTL(t time.Duration) optparams.Option[ClThrottleOpts] + func WithTTLAtFirstTime(t time.Duration) optparams.Option[ClThrottleOpts] + func WithTaskCron(taskCron *cron.Cron) optparams.Option[Options] + type ClThrottleInPipePlacehold struct + Cmd *redis.Cmd + func ClThrottleInPipe(pipe redis.Pipeliner, ctx context.Context, key string, count int64, ...) *ClThrottleInPipePlacehold + func (r *ClThrottleInPipePlacehold) Result() (*RedisCellStatus, error) + type ClThrottleOpts struct + CountPerPeriod int64 + MaxBurst int64 + Period int64 + RefreshOpts []optparams.Option[middlewarehelper.RefreshOpt] + type Options struct + CountPerPeriod int64 + MaxBurst int64 + MiddlewareOpts []optparams.Option[middlewarehelper.Options] + Middlewaretype string + Period int64 + type RedisCell struct + func New(cli redis.UniversalClient, opts ...optparams.Option[Options]) (*RedisCell, error) + func (c *RedisCell) ClThrottle(ctx context.Context, count int64, opts ...optparams.Option[ClThrottleOpts]) (*RedisCellStatus, error) + func (c *RedisCell) Clean(ctx context.Context) error + type RedisCellStatus struct + Blocked bool + Max int64 + Remaining int64 + ResetToMaxTime int64 + WaitForRetryTime int64