Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GoRedisRate ¶
type GoRedisRate struct {
// contains filtered or unexported fields
}
func NewGoRedis ¶
func NewGoRedis(rdb *redis.Client, rps float64, burst int) *GoRedisRate
type Mutex ¶
type RWMutex ¶
type RWMutex struct { M map[string]limiter.Limiter R float64 B int // contains filtered or unexported fields }
func NewRWMutex ¶
func NewRWMutex(constructor NewLimiterFn, reqPerSec float64, burst int) *RWMutex
type Ratelimiter ¶
func NewDefaultRatelimiter ¶
func NewDefaultRatelimiter(reqPerSec float64, burst int) Ratelimiter
type RedisDelayedSync ¶
type RedisDelayedSync struct {
// contains filtered or unexported fields
}
func NewRedisDelayedSync ¶
func NewRedisDelayedSync(ctx context.Context, opt RedisDelayedSyncOption) *RedisDelayedSync
type RedisDelayedSyncOption ¶
type SyncMapLoadOrStore ¶
func NewSyncMapLoadOrStore ¶
func NewSyncMapLoadOrStore(constructor NewLimiterFn, reqPerSec float64, burst int) *SyncMapLoadOrStore
type SyncMapLoadThenLoadOrStore ¶
type SyncMapLoadThenLoadOrStore struct { R float64 B int // contains filtered or unexported fields }
func NewSyncMapLoadThenLoadOrStore ¶
func NewSyncMapLoadThenLoadOrStore(constructor NewLimiterFn, reqPerSec float64, burst int) *SyncMapLoadThenLoadOrStore
func (*SyncMapLoadThenLoadOrStore) Allow ¶
func (d *SyncMapLoadThenLoadOrStore) Allow(key string) (bool, error)
type SyncMapLoadThenStore ¶
func NewSyncMapLoadThenStore ¶
func (*SyncMapLoadThenStore[l]) Allow ¶
func (r *SyncMapLoadThenStore[l]) Allow(key string) (bool, error)
func (*SyncMapLoadThenStore[L]) AllowN ¶
func (r *SyncMapLoadThenStore[L]) AllowN(key string, n int) (bool, error)
func (*SyncMapLoadThenStore[L]) GetLimiter ¶
func (r *SyncMapLoadThenStore[L]) GetLimiter(key string) L
Click to show internal directories.
Click to hide internal directories.