Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiLimiter ¶
type ApiLimiter struct {
// contains filtered or unexported fields
}
ApiLimiter allows to rate limit API calls
func NewApiLimiter ¶
func NewApiLimiter(metrics MetricsAPI, rateLimit float64, burst int) *ApiLimiter
NewApiLimiter returns a new API limiter with the specific rate limit and burst configuration. The MetricsAPI interface is called to allow for metrics accounting.
type DelaySimulator ¶
type DelaySimulator struct {
// contains filtered or unexported fields
}
DelaySimulator simulates delays in API calls
func NewDelaySimulator ¶
func NewDelaySimulator() *DelaySimulator
NewDelaySimulator returns a new DelaySimulator
func (*DelaySimulator) Delay ¶
func (d *DelaySimulator) Delay(op Operation)
Delay delays an API operation according to the configuration
type MetricsAPI ¶
MetricsAPI represents the metrics maintained by the API limiter
Click to show internal directories.
Click to hide internal directories.