Versions in this module Expand all Collapse all v2 v2.0.5 Feb 19, 2024 v2.0.4 Feb 16, 2024 Changes in this version + var DataTTL = 10 * time.Minute + var ErrLimited = errors.New("rate limit exceded") + func PseudoFNV64a(s string) uint64 + type Backend interface + Load func(string, func() interface{}) interface{} + Store func(string, interface{}) error + type Hasher func(string) uint64 + type Limiter interface + Allow func() bool + type LimiterStore func(string) Limiter + type MemoryBackend struct + func NewMemoryBackend(ctx context.Context, ttl time.Duration) *MemoryBackend + func (m *MemoryBackend) Load(key string, f func() interface{}) interface{} + func (m *MemoryBackend) Store(key string, v interface{}) error + type ShardedMemoryBackend struct + func DefaultShardedMemoryBackend(ctx context.Context) *ShardedMemoryBackend + func NewShardedMemoryBackend(ctx context.Context, shards uint64, ttl time.Duration, h Hasher) *ShardedMemoryBackend + func (b *ShardedMemoryBackend) Load(key string, f func() interface{}) interface{} + func (b *ShardedMemoryBackend) Store(key string, v interface{}) error Other modules containing this package github.com/davron112/krakend-ratelimit/v3