Documentation
¶
Overview ¶
Package ratelimit contains a collection of curated rate limit adaptors for the Sonic API Gateway
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLimited = errors.New("ERROR: rate limit exceeded") DataTTL = 10 * time.Minute )
Functions ¶
func PseudoFNV64a ¶
Types ¶
type LimiterStore ¶
type MemoryBackend ¶
type MemoryBackend struct {
// contains filtered or unexported fields
}
func NewMemoryBackend ¶
func NewMemoryBackend(ctx context.Context, ttl time.Duration) *MemoryBackend
func (*MemoryBackend) Load ¶
func (m *MemoryBackend) Load(key string, f func() interface{}) interface{}
func (*MemoryBackend) Store ¶
func (m *MemoryBackend) Store(key string, v interface{}) error
type ShardedMemoryBackend ¶
type ShardedMemoryBackend struct {
// contains filtered or unexported fields
}
func DefaultShardedMemoryBackend ¶
func DefaultShardedMemoryBackend(ctx context.Context) *ShardedMemoryBackend
func NewShardedMemoryBackend ¶
func (*ShardedMemoryBackend) Load ¶
func (b *ShardedMemoryBackend) Load(key string, f func() interface{}) interface{}
func (*ShardedMemoryBackend) Store ¶
func (b *ShardedMemoryBackend) Store(key string, v interface{}) error
Directories
¶
Path | Synopsis |
---|---|
Package juju provides a set of rate-limit proxy and router middlewares using the github.com/juju/ratelimit lib
|
Package juju provides a set of rate-limit proxy and router middlewares using the github.com/juju/ratelimit lib |
proxy
Package proxy provides a rate-limit proxy middleware using the github.com/juju/ratelimit lib
|
Package proxy provides a rate-limit proxy middleware using the github.com/juju/ratelimit lib |
router
Package router provides several rate-limit routers using the github.com/juju/ratelimit lib.
|
Package router provides several rate-limit routers using the github.com/juju/ratelimit lib. |
Package rate provides a set of rate-limit proxy and router middlewares using the golang.org/x/time/rate lib
|
Package rate provides a set of rate-limit proxy and router middlewares using the golang.org/x/time/rate lib |
router
Package router provides several rate-limit routers using the golang.org/x/time/rate lib
|
Package router provides several rate-limit routers using the golang.org/x/time/rate lib |
Click to show internal directories.
Click to hide internal directories.