Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LimitHandler ¶
type LimitHandler struct {
// contains filtered or unexported fields
}
LimitHandler is middleware which limits the current number of active connections that this handler can sustain. Once the current connections equal the max http.StatusTooManyRequests is returned
func NewLimitHandler ¶
func NewLimitHandler(connections int, next http.Handler) *LimitHandler
NewLimitHandler creates a new instance of the LimitHandler for the given parameters.
func (*LimitHandler) ServeHTTP ¶
func (l *LimitHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.