Expand description
HTTP transport shared by every forge adapter.
Retrying, timing out, paging, and mapping a status to a failure class are
the same problem for Forgejo and GitHub; only the paths and payloads
differ. Adapter-specific status meaning (for example, that Forgejo
answers 403 on branch protection create when the rule already exists) is
resolved by the one call site that needs it, by matching on the
TransportError variant that call produced.
StructsΒ§
- Http
- Shared HTTP transport for a forgeβs REST API.
- Request
Label - The method and path of a request, as it appears in an error.
- Retry
Policy - How a retryable failure is retried before it is reported.
- Transport
Build Error - Failure building the underlying HTTP client.
EnumsΒ§
- Transport
Error - Anything that stops a request from producing a usable answer.
ConstantsΒ§
- DEFAULT_
PAGE_ πLIMIT - The most pages a listing may span unless
Http::with_page_limitsays otherwise. - MAX_
RATE_ πLIMIT_ WAIT - The longest wait a rate-limited request honours. A forge that asks for
more makes the request fail with
TransportError::RateLimitWaitTooLong. - RATE_
LIMIT_ πREMAINING - RATE_
LIMIT_ πRESET
FunctionsΒ§
- log_
retry π - Log a retryable failure before the attempt that follows it.
- rate_
limit_ πwait - How long the response asks the caller to wait before retrying.
- retry_
wait π - The wait before retrying
error, which is the wait the forge stated or elsebackoff. A stated wait above the cap fails the request. - retryable π
- A rate limit is retried for every method, because the forge refused the request without applying it. Anything else is retried only for an idempotent method, because it does not tell whether the forge applied it.
- summarize
- Trim a forge error body so a huge HTML page cannot flood the output.