Documentation
¶
Index ¶
Constants ¶
View Source
const ( SecondaryRateLimitMessage = `You have exceeded a secondary rate limit. Please wait a few minutes before you try again.` SecondaryRateLimitDocumentationURL = `https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits` SecondaryRateLimitAlternateDocumentationURL = `https://docs.github.com/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits` )
View Source
const (
InvalidBodyContent = `{"message": "not as expected"}`
)
Variables ¶
This section is empty.
Functions ¶
func NewRateLimitInjecter ¶
func NewRateLimitInjecter(base http.RoundTripper, options *SecondaryRateLimitInjecterOptions) (http.RoundTripper, error)
Types ¶
type SecondaryRateLimitInjecter ¶
type SecondaryRateLimitInjecter struct {
AbuseAttempts int
// contains filtered or unexported fields
}
func (*SecondaryRateLimitInjecter) CurrentSleepEnd ¶
func (r *SecondaryRateLimitInjecter) CurrentSleepEnd() time.Time
func (*SecondaryRateLimitInjecter) NextSleepStart ¶
func (r *SecondaryRateLimitInjecter) NextSleepStart() time.Time
type SecondaryRateLimitInjecterOptions ¶
type SecondaryRateLimitInjecterOptions struct {
Every time.Duration
Sleep time.Duration
InvalidBody bool
UseXRateLimit bool
UsePrimaryRateLimit bool
UseAlternateDocumentationURL bool
}
func (*SecondaryRateLimitInjecterOptions) IsNoop ¶
func (r *SecondaryRateLimitInjecterOptions) IsNoop() bool
func (*SecondaryRateLimitInjecterOptions) Validate ¶
func (r *SecondaryRateLimitInjecterOptions) Validate() error
Click to show internal directories.
Click to hide internal directories.