connlimit

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2014 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Simultaneous connection limiter

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionLimiter

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

This limiter tracks concurrent connection per token and is capable of rejecting connections if they are failed

func NewClientIpLimiter

func NewClientIpLimiter(maxConnections int64) (*ConnectionLimiter, error)

func NewConnectionLimiter

func NewConnectionLimiter(mapper limit.MapperFn, maxConnections int64) (*ConnectionLimiter, error)

func (*ConnectionLimiter) GetConnectionCount

func (cl *ConnectionLimiter) GetConnectionCount() int64

func (*ConnectionLimiter) GetMaxConnections

func (cl *ConnectionLimiter) GetMaxConnections() int64

func (*ConnectionLimiter) ProcessRequest

func (cl *ConnectionLimiter) ProcessRequest(r request.Request) (*http.Response, error)

func (*ConnectionLimiter) ProcessResponse

func (cl *ConnectionLimiter) ProcessResponse(r request.Request, a request.Attempt)

func (*ConnectionLimiter) SetMaxConnections

func (cl *ConnectionLimiter) SetMaxConnections(max int64)

Jump to

Keyboard shortcuts

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