Skip to main content

Module http

Module http 

Source
Expand description

Native reqwest HTTP client for the GitHub API — replaces gh CLI subprocesses.

Uses a shared reqwest::Client with connection pooling, reads rate-limit headers proactively, and supports concurrent requests via tokio::join!.

Auth: uses the centralized [TokenResolver] which supports:

  • GH_TOKEN / GITHUB_TOKEN environment variables
  • gh.auth.token config value
  • gh auth token CLI fallback (default — just run gh auth login)

Structs§

CommitMeta
Read behind_by out of a compare response.
GhHttp
Native HTTP client for the GitHub API with connection pooling and proactive rate-limit avoidance.
PrReviewBatchData
Data fetched for one PR by GhHttp::batch_fetch_pr_review_data.
RateLimitMetrics
Snapshot of GitHub API rate-limit metrics.

Functions§

drain_call_counts
Take the call counts accumulated since the last drain, largest first.
has_status
A branch protection read that means “no protection”: 404 “Branch not protected”, or the 403 True when text carries the HTTP status in the failed (404 ...) form that every request error here uses, or HTTP 404 from the CLI. The status code sits apart from the URL, so an issue number such as 1404 does not match
rate_limit_metrics
Return a snapshot of GitHub API rate-limit metrics.
status_label_color
Return the hex color string for a given status:* label.