connlimit

package
v0.0.0-...-11931f5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "connlimit"

Variables

This section is empty.

Functions

func CliFlags

func CliFlags() []cli.Flag

func FromCli

func FromCli(c *cli.Context) (plugin.Middleware, error)

Constructs the middleware from the command line

func FromOther

func FromOther(c ConnLimit) (plugin.Middleware, error)

func GetSpec

func GetSpec() *plugin.MiddlewareSpec

Types

type ConnLimit

type ConnLimit struct {
	Connections int64
	Variable    string // Variable defines how the limiting should be done. e.g. 'client.ip' or 'request.header.X-My-Header'
}

Control simultaneous connections for a location per some variable.

func NewConnLimit

func NewConnLimit(connections int64, variable string) (*ConnLimit, error)

func (*ConnLimit) NewHandler

func (c *ConnLimit) NewHandler(next http.Handler) (http.Handler, error)

Returns vulcan library compatible middleware

func (*ConnLimit) String

func (c *ConnLimit) String() string

Jump to

Keyboard shortcuts

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