Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Throttle ¶
type Throttle struct {
// contains filtered or unexported fields
}
Throttle implements gonsq.MiddlewareFunc.
func New ¶
New throttle middleware. Create a new object and initialize the rate-limiter based on the throttleLimit and loosenLimit. This because the gonsq have two level of throttling: throttle and loosenThrottle.
func (*Throttle) Throttle ¶
func (tm *Throttle) Throttle(handler gonsq.HandlerFunc) gonsq.HandlerFunc
Throttle middleware for nsq. This middleware check whether there is some information about throttling in the message.
Click to show internal directories.
Click to hide internal directories.