githuberrors

package
v1.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL