mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
30 lines
668 B
Go
30 lines
668 B
Go
package request
|
|
|
|
// WithBackoff configures the backoff strategy for a Requester.
|
|
func WithBackoff(b Backoff) RequesterOption {
|
|
return func(r *Requester) {
|
|
r.backoff = b
|
|
}
|
|
}
|
|
|
|
// WithLimiter configures the rate limiter for a Requester.
|
|
func WithLimiter(l Limiter) RequesterOption {
|
|
return func(r *Requester) {
|
|
r.limiter = l
|
|
}
|
|
}
|
|
|
|
// WithRetryPolicy configures the retry policy for a Requester.
|
|
func WithRetryPolicy(p RetryPolicy) RequesterOption {
|
|
return func(r *Requester) {
|
|
r.retryPolicy = p
|
|
}
|
|
}
|
|
|
|
// WithReporter configures the reporter for a Requester.
|
|
func WithReporter(rep Reporter) RequesterOption {
|
|
return func(r *Requester) {
|
|
r.reporter = rep
|
|
}
|
|
}
|