Documentation
¶
Overview ¶
Package github is a client for the pieces of the GitHub API forge-dashboard needs: which repositories the credential can write to, their open pull requests and issues, and combined CI status per pull request. With a token, it talks to GitHub's GraphQL API — one request returns everything a REST-based Client used to need one call per repo/PR/CI-check for, and GraphQL draws from its own separate rate-limit pool rather than the REST budget every other tool on the account shares. GraphQL requires authentication for every request, so the username-only (public repos, no token) mode still uses REST — a fallback path that was never part of the authenticated budget anyway.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to GitHub, either as an authenticated user (a token, GraphQL) or anonymously against one user's public repositories (a username, no token, REST — GraphQL allows no anonymous access at all).
func NewClient ¶
NewClient returns a Client. With token set, Fetch queries GraphQL for every repo the token can push to, private included. With token empty and username set, Fetch falls back to unauthenticated REST and returns only username's public repos — there's no "write access" to filter by without a credential, so this mode returns everything public GitHub already shows anyone. baseURL defaults to the real GitHub API; tests override it to point at an httptest.Server.