connlimit

package
v1.34.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnLimit

type ConnLimit struct{}

func NewConnLimit

func NewConnLimit() *ConnLimit

func (ConnLimit) Handler

func (ConnLimit) Handler(proxyRoute gobis.ProxyRoute, params interface{}, handler http.Handler) (http.Handler, error)

func (ConnLimit) Schema

func (ConnLimit) Schema() interface{}

type ConnLimitConfig

type ConnLimitConfig struct {
	ConnLimit *ConnLimitOptions `mapstructure:"conn_limit" json:"conn_limit" yaml:"conn_limit"`
}

type ConnLimitOptions

type ConnLimitOptions struct {
	// enable conn limit middleware
	Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
	// Limit number of simultaneous connection (default to 20)
	Limit int64 `mapstructure:"limit" json:"limit" yaml:"limit"`
	// Identify request source to limit the source
	// possible value are 'client.ip', 'request.host' or 'request.header.X-My-Header-Name'
	// (default: client.ip)
	// if empty and a username exists in context the source will be set to this content (this allow to conn limit by username from auth middleware)
	// for context see: https://godoc.org/github.com/orange-cloudfoundry/gobis/proxy/ctx#Username
	SourceIdentifier string `mapstructure:"source_identifier" json:"source_identifier" yaml:"source_identifier"`
}

Jump to

Keyboard shortcuts

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