Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRepo ¶
ParseRepo parses "owner/repo", "https://github.com/owner/repo", or "https://github.com/owner/repo/..." into (owner, repo) strings. Returns error if format is unrecognized.
Types ¶
type Contributor ¶
type Contributor struct {
Login string // GitHub username
HTMLURL string // profile URL
AvatarURL string // avatar URL
Contributions int // commit count — used directly as proportional weight
}
Contributor holds a GitHub contributor with commit count.
func FetchContributors ¶
func FetchContributors(ctx context.Context, owner, repo, token string) ([]Contributor, error)
FetchContributors fetches contributors from GET https://api.github.com/repos/{owner}/{repo}/contributors. Paginates (100 per page) until all contributors are fetched. token is optional.
type RepoInfo ¶
type RepoInfo struct {
Owner string // e.g. "GainForest"
Name string // e.g. "hypercerts-cli"
FullName string // e.g. "GainForest/hypercerts-cli"
Description string // repo description
HTMLURL string // e.g. "https://github.com/GainForest/hypercerts-cli"
CreatedAt string // RFC3339 timestamp
PushedAt string // RFC3339 timestamp
Language string // primary language
Topics []string // repo topics
License string // SPDX ID (e.g. "MIT"), empty if none
AvatarURL string // owner avatar URL
}
RepoInfo holds parsed GitHub repo metadata.
func FetchRepo ¶
FetchRepo fetches repo metadata from GET https://api.github.com/repos/{owner}/{repo}. token is optional (empty string = unauthenticated). Returns error on non-200 status (include status code in error message).