Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
func NewLimiter ¶
func NewLimiter(rdb rediser) *Limiter
type Result ¶
type Result struct { // Limit is the limit that was used to obtain this result. Limit *Limit // Allowed reports whether event may happen at time now. Allowed bool // Remaining is the maximum number of requests that could be // permitted instantaneously for this key given the current // state. For example, if a rate limiter allows 10 requests per // second and has already received 6 requests for this key this // second, Remaining would be 4. Remaining int }
Click to show internal directories.
Click to hide internal directories.