Documentation ¶
Index ¶
- func PerDay(maxAttempts int) contractshttp.ILimit
- func PerDays(decayDays, maxAttempts int) contractshttp.ILimit
- func PerHour(maxAttempts int) contractshttp.ILimit
- func PerHours(decayHours, maxAttempts int) contractshttp.ILimit
- func PerMinute(maxAttempts int) contractshttp.ILimit
- func PerMinutes(decayMinutes, maxAttempts int) contractshttp.ILimit
- type Limit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PerDay ¶
func PerDay(maxAttempts int) contractshttp.ILimit
func PerDays ¶
func PerDays(decayDays, maxAttempts int) contractshttp.ILimit
func PerHour ¶
func PerHour(maxAttempts int) contractshttp.ILimit
func PerHours ¶
func PerHours(decayHours, maxAttempts int) contractshttp.ILimit
func PerMinute ¶
func PerMinute(maxAttempts int) contractshttp.ILimit
func PerMinutes ¶
func PerMinutes(decayMinutes, maxAttempts int) contractshttp.ILimit
Types ¶
type Limit ¶
type Limit struct { // The rate limit signature key. Key string // The maximum number of attempts allowed within the given number of minutes. MaxAttempts int // The number of minutes until the rate limit is reset. DecayMinutes int // The response generator callback. ResponseCallback func(ctx contractshttp.Context) }
func (*Limit) Response ¶
func (r *Limit) Response(callable func(ctx contractshttp.Context)) contractshttp.ILimit
Click to show internal directories.
Click to hide internal directories.