Documentation ¶
Index ¶
Constants ¶
View Source
const ( SecondaryRateLimitMessage = `You have exceeded a secondary rate limit` SecondaryRateLimitDocumentationPathSuffix = `secondary-rate-limits` HeaderXRateLimitRemaining = "x-ratelimit-remaining" HeaderRetryAfter = "retry-after" HeaderXRateLimitReset = "x-ratelimit-reset" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SecondaryRateLimitBody ¶
type SecondaryRateLimitBody struct { Message string `json:"message"` DocumentURL string `json:"documentation_url"` }
func (SecondaryRateLimitBody) IsSecondaryRateLimit ¶
func (s SecondaryRateLimitBody) IsSecondaryRateLimit() bool
IsSecondaryRateLimit checks whether the response is a legitimate secondary rate limit. It checks the prefix of the message and the suffix of the documentation URL in the response body in case the message or documentation URL is modified in the future. https://docs.github.com/en/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits
type SecondaryRateLimitError ¶
type SecondaryRateLimitError struct { Response http.Response Body *SecondaryRateLimitBody RetryAfter *time.Time }
func IsSecondaryRateLimitError ¶
func IsSecondaryRateLimitError(r *github.Response) (bool, *SecondaryRateLimitError)
func (*SecondaryRateLimitError) Error ¶
func (s *SecondaryRateLimitError) Error() string
Click to show internal directories.
Click to hide internal directories.