Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrTooManyRequests ¶
func (*ErrTooManyRequests) Error ¶
func (e *ErrTooManyRequests) Error() string
type Provider ¶
type Provider interface {
// Limit returns the policy based rate limit for the given actor performing the action on the path.
Limit(actor, action, path string) (RateLimit, error)
// Allow returns true if the rate limit policy allows the given actor to perform the action on the path.
Allow(actor, action, path string) (bool, error)
Ping() error
Close()
}
type RateLimit ¶
RateLimit encodes a maximum number of repititions allowed over a time interval.
func FromString ¶
FromString parses a rate limit string in the form of "<limit>/<duration>".
Click to show internal directories.
Click to hide internal directories.