limit

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

limit

-- import "github.com/Clever/sphinx/limit"

Usage

type Limit
type Limit interface {
	Name() string
	Match(common.Request) bool
	Add(common.Request) (leakybucket.BucketState, error)
}

Limit has methods for matching and adding to a limit

func New
func New(name string, config config.Limit, storage leakybucket.Storage) (Limit, error)

New creates a new Limit

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limit

type Limit interface {
	Name() string
	Match(common.Request) bool
	Add(common.Request) (leakybucket.BucketState, error)
}

Limit has methods for matching and adding to a limit

func New

func New(name string, config config.Limit, storage leakybucket.Storage) (Limit, error)

New creates a new Limit

Jump to

Keyboard shortcuts

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