Documentation
¶
Overview ¶
Simultaneous connection limiter
Index ¶
- type ConnectionLimiter
- func (cl *ConnectionLimiter) GetConnectionCount() int64
- func (cl *ConnectionLimiter) GetMaxConnections() int64
- func (cl *ConnectionLimiter) ProcessRequest(r request.Request) (*http.Response, error)
- func (cl *ConnectionLimiter) ProcessResponse(r request.Request, a request.Attempt)
- func (cl *ConnectionLimiter) SetMaxConnections(max int64)
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 (*ConnectionLimiter) ProcessResponse ¶
func (cl *ConnectionLimiter) ProcessResponse(r request.Request, a request.Attempt)
func (*ConnectionLimiter) SetMaxConnections ¶
func (cl *ConnectionLimiter) SetMaxConnections(max int64)
Click to show internal directories.
Click to hide internal directories.