Documentation
¶
Index ¶
Constants ¶
View Source
const (
InvalidBodyContent = `{"message": "not as expected"}`
)
View Source
const (
SecondaryRateLimitMessage = `You have exceeded a secondary rate limit. Please wait a few minutes before you try again.`
)
Variables ¶
View Source
var SecondaryRateLimitDocumentationURLs = []string{
`https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits`,
`https://docs.github.com/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits`,
`https://docs.github.com/en/free-pro-team@latest/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits`,
}
View Source
var SecondaryRateLimitStatusCodes = []int{ http.StatusForbidden, http.StatusTooManyRequests, }
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 DocumentationURL string HttpStatusCode int }
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.