krakendrate

package module
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

KrakenD rate limit

A collection of rate limit adaptors for the KrakenD

Notice: this package requires KrakenD >= 0.4

rate

The package rate contains a proxy adaptor and several router middlewares over the golang.org/x/time/rate lib

juju

The package juju contains a proxy adaptor and several router middlewares over the github.com/juju/ratelimit lib

Documentation

  1. Official: http://www.krakend.io/docs/throttling/rate-limit/

  2. Autogenerated: https://godoc.org/github.com/devopsfaith/krakend-ratelimit

Documentation

Overview

krakendrate contains a collection of curated rate limit adaptors for the KrakenD framework

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLimited is the error returned when the rate limit has been exceded
	ErrLimited = errors.New("ERROR: rate limit exceded")

	DataTTL = 10 * time.Minute
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Load(string) (interface{}, bool)
	Store(string, interface{}) error
}

Backend is the interface of the persistence layer

type Limiter

type Limiter interface {
	Allow() bool
}

Limiter defines a simple interface for a rate limiter

type LimiterStore

type LimiterStore func(string) Limiter

LimiterStore defines the interface for a limiter lookup function

type MemoryBackend

type MemoryBackend struct {
	// contains filtered or unexported fields
}

MemoryBackend implements the backend interface by wrapping a sync.Map

func NewMemoryBackend

func NewMemoryBackend() *MemoryBackend

func (*MemoryBackend) Load

func (m *MemoryBackend) Load(key string) (interface{}, bool)

Load implements the Backend interface

func (*MemoryBackend) Store

func (m *MemoryBackend) Store(key string, v interface{}) error

Store implements the Backend interface

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.
proxy
Package proxy provides a rate-limit proxy middleware using the golang.org/x/time/rate lib.
Package proxy provides a rate-limit proxy middleware 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL