Documentation
¶
Overview ¶
Package github implements the read-only Source for GitHub.com (and, by base URL, GitHub Enterprise Server). Auth is a GitHub App installation token, short-lived, least-privilege, and App-compatible. Metadata uses per-resource REST endpoints, not the Migrations API.
Index ¶
- type Options
- type Source
- func (s *Source) CloneURL(_ context.Context, r source.Repo) (string, error)
- func (s *Source) FetchMetadata(ctx context.Context, r source.Repo) ([]byte, error)
- func (s *Source) GitAuthHeader(ctx context.Context) (string, error)
- func (s *Source) ListRepos(ctx context.Context, f source.Filter) ([]source.Repo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
BaseURL string // empty = github.com; GHES: https://host/api/v3
AppID int64
InstallationID int64
PrivateKeyPEM []byte
}
Options configures the GitHub source.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a read-only GitHub backend.
func (*Source) FetchMetadata ¶
FetchMetadata dumps per-resource metadata as gitdr.meta/v1 JSON using App-compatible per-resource REST endpoints (never the Migrations API).
func (*Source) GitAuthHeader ¶
GitAuthHeader mints an installation token and returns it as a Basic auth header (username x-access-token). Injected into git via env so it never hits argv.