Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateBackoff ¶
CalculateBackoff calculates exponential backoff with jitter.
func ShouldRetry ¶
ShouldRetry determines if a response indicates we should retry.
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter handles API rate limiting with retry logic.
func NewLimiter ¶
NewLimiter creates a new rate limiter with default settings.
func (*Limiter) SetRetryAfter ¶
SetRetryAfter sets the retry-after duration.
func (*Limiter) UpdateFromHeaders ¶
UpdateFromHeaders updates rate limit information from response headers. Supports GitHub (X-RateLimit-*) and GitLab (RateLimit-*) headers.
type RetryableError ¶
type RetryableError struct {
Err error
RetryAfter time.Duration
AttemptsLeft int
NextRetryTime time.Time
}
RetryableError represents an error that can be retried.
func (*RetryableError) Error ¶
func (e *RetryableError) Error() string
func (*RetryableError) IsRetryable ¶
func (e *RetryableError) IsRetryable() bool
IsRetryable returns true if the error is retryable.
func (*RetryableError) Unwrap ¶
func (e *RetryableError) Unwrap() error
Unwrap returns the underlying error.
Click to show internal directories.
Click to hide internal directories.