Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type V2 ¶
type V2 interface {
// Access the rate limited resource. Returns a duration or an error if the
// rate limit check fails. The returned duration is either zero (meaning the
// resource can be accessed) or a reasonable length of time to wait before
// requesting again.
Access(ctx context.Context) (time.Duration, error)
// Close the component, blocks until either the underlying resources are
// cleaned up or the context is cancelled. Returns an error if the context
// is cancelled.
Close(ctx context.Context) error
}
V2 is a simpler interface to implement than types.RateLimit.
Click to show internal directories.
Click to hide internal directories.