Documentation
¶
Index ¶
- func PerDay(maxAttempts int) contractshttp.Limit
- func PerDays(decayDays, maxAttempts int) contractshttp.Limit
- func PerHour(maxAttempts int) contractshttp.Limit
- func PerHours(decayHours, maxAttempts int) contractshttp.Limit
- func PerMinute(maxAttempts int) contractshttp.Limit
- func PerMinutes(decayMinutes, maxAttempts int) contractshttp.Limit
- type Limit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PerDay ¶
func PerDay(maxAttempts int) contractshttp.Limit
func PerDays ¶
func PerDays(decayDays, maxAttempts int) contractshttp.Limit
func PerHour ¶
func PerHour(maxAttempts int) contractshttp.Limit
func PerHours ¶
func PerHours(decayHours, maxAttempts int) contractshttp.Limit
func PerMinute ¶
func PerMinute(maxAttempts int) contractshttp.Limit
func PerMinutes ¶
func PerMinutes(decayMinutes, maxAttempts int) contractshttp.Limit
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.Limit
Click to show internal directories.
Click to hide internal directories.