Documentation
¶
Index ¶
- Constants
- func NewRatelimit(client nw_client.Rest) nw_client.Rest
- func NewRetry(client nw_client.Rest) nw_client.Rest
- type ErrorRateLimit
- func NewErrorRateLimit(limit, remaining int, reset time.Time) *ErrorRateLimit
- func NewErrorRateLimitFromHeaders(headers map[string]string) (erl *ErrorRateLimit, found bool)
- func NewErrorRateLimitFromHeadersFallback(headers map[string]string) (erl *ErrorRateLimit)
- func NewErrorRateLimitResetOnly(reset time.Time) *ErrorRateLimit
- type RateLimit
- type Retry
Constants ¶
View Source
const ( // Retry-After: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After HeaderRetryAfter = "Retry-After" // GitHub API HeaderXRateLimitLimit = "X-RateLimit-Limit" HeaderXRateLimitRemaining = "X-RateLimit-Remaining" HeaderXRateLimitReset = "X-RateLimit-Reset" // https://tools.ietf.org/id/draft-polli-ratelimit-headers-00.html HeaderRateLimitLimit = "RateLimit-Limit" HeaderRateLimitRemaining = "RateLimit-Remaining" HeaderRateLimitReset = "RateLimit-Reset" // Default time of retry-after, if the value is was not found or invalid. DefaultRetryAfterSec = 10 // If the value exceeds below time (2000-01-01T00:00:00Z), assume the value is an unix time. RetryAfterSecOrFixDate = 946684800 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorRateLimit ¶
func NewErrorRateLimit ¶
func NewErrorRateLimit(limit, remaining int, reset time.Time) *ErrorRateLimit
func NewErrorRateLimitFromHeaders ¶
func NewErrorRateLimitFromHeaders(headers map[string]string) (erl *ErrorRateLimit, found bool)
func NewErrorRateLimitFromHeadersFallback ¶
func NewErrorRateLimitFromHeadersFallback(headers map[string]string) (erl *ErrorRateLimit)
func NewErrorRateLimitResetOnly ¶
func NewErrorRateLimitResetOnly(reset time.Time) *ErrorRateLimit
func (ErrorRateLimit) Error ¶
func (z ErrorRateLimit) Error() string
type RateLimit ¶
type RateLimit struct {
// contains filtered or unexported fields
}
func (RateLimit) Call ¶
func (z RateLimit) Call(ctx api_context.Context, req nw_client.RequestBuilder) (res es_response.Response)
type Retry ¶
type Retry struct {
// contains filtered or unexported fields
}
func (*Retry) Call ¶
func (z *Retry) Call(ctx api_context.Context, req nw_client.RequestBuilder) (res es_response.Response)
Click to show internal directories.
Click to hide internal directories.