Documentation
¶
Index ¶
- type CodeSample
- type Comment
- type CommitData
- type CrawlResult
- func (r *CrawlResult) TotalCommits() int
- func (r *CrawlResult) TotalDiscussions() int
- func (r *CrawlResult) TotalExternalPRs() int
- func (r *CrawlResult) TotalGists() int
- func (r *CrawlResult) TotalIssues() int
- func (r *CrawlResult) TotalProjects() int
- func (r *CrawlResult) TotalReleases() int
- func (r *CrawlResult) TotalReviews() int
- func (r *CrawlResult) TotalStarred() int
- type Crawler
- type DiscussionData
- type EventData
- type GistData
- type GistFile
- type GraphQLPool
- type IssueData
- type ProjectData
- type PullRequestData
- type ReleaseData
- type RepoData
- type ReviewComment
- type ReviewData
- type StarredRepo
- type TokenPool
- type UserProfile
- type WikiPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeSample ¶
CodeSample holds a source file's path and content.
type CommitData ¶
type CommitData struct {
SHA string
Message string
Date time.Time
Patch string
Additions int
Deletions int
FilesChanged int
}
CommitData holds a commit's metadata, optional diff patch, and change stats.
type CrawlResult ¶
type CrawlResult struct {
User UserProfile
Repos []RepoData
IssueComments []Comment
StarredRepos []StarredRepo
Gists []GistData
Orgs []string
AuthoredIssues []IssueData
ExternalPRs []PullRequestData
Events []EventData
Discussions []DiscussionData
Projects []ProjectData
}
CrawlResult holds all data collected from a user's GitHub activity.
func (*CrawlResult) TotalCommits ¶
func (r *CrawlResult) TotalCommits() int
TotalCommits returns the sum of commits across all repos.
func (*CrawlResult) TotalDiscussions ¶
func (r *CrawlResult) TotalDiscussions() int
func (*CrawlResult) TotalExternalPRs ¶
func (r *CrawlResult) TotalExternalPRs() int
func (*CrawlResult) TotalGists ¶
func (r *CrawlResult) TotalGists() int
func (*CrawlResult) TotalIssues ¶
func (r *CrawlResult) TotalIssues() int
func (*CrawlResult) TotalProjects ¶
func (r *CrawlResult) TotalProjects() int
func (*CrawlResult) TotalReleases ¶
func (r *CrawlResult) TotalReleases() int
func (*CrawlResult) TotalReviews ¶
func (r *CrawlResult) TotalReviews() int
TotalReviews returns the sum of review artifacts across all repos. It counts review summaries, line comments, and falls back to PR conversation comments when no richer review data exists for a repo.
func (*CrawlResult) TotalStarred ¶
func (r *CrawlResult) TotalStarred() int
type Crawler ¶
type Crawler struct {
// contains filtered or unexported fields
}
Crawler fetches a GitHub user's repositories, commits, PRs, and comments.
func NewCrawler ¶
NewCrawler returns a Crawler authenticated with the given tokens. maxRepos controls how many repos get deep-crawled (commits, PRs, code samples). privateToken is optional; when set it enables fetching private repos via the authenticated user's /user/repos endpoint.
type DiscussionData ¶
type DiscussionData struct {
Repo string
Number int
Title string
Body string
Category string
Author string
URL string
CreatedAt time.Time
Comments []Comment
}
DiscussionData holds metadata for a GitHub discussion.
type GistData ¶
type GistData struct {
ID string
Description string
Files []GistFile
Public bool
CreatedAt time.Time
UpdatedAt time.Time
}
GistData holds metadata for a user's gist.
type GraphQLPool ¶
type GraphQLPool struct {
// contains filtered or unexported fields
}
GraphQLPool distributes GraphQL requests across multiple authenticated clients.
func NewGraphQLPool ¶
func NewGraphQLPool(tokens []string) *GraphQLPool
NewGraphQLPool creates a pool of GitHub GraphQL clients, one per token.
func (*GraphQLPool) Next ¶
func (p *GraphQLPool) Next() *githubv4.Client
Next returns the next client in round-robin order.
type IssueData ¶
type IssueData struct {
Repo string
Number int
Title string
Body string
State string
Labels []string
CreatedAt time.Time
}
IssueData holds metadata for an issue authored by the user.
type ProjectData ¶
type ProjectData struct {
Title string
Body string
URL string
Public bool
CreatedAt time.Time
ItemCount int
}
ProjectData holds metadata for a GitHub Projects v2 project.
type PullRequestData ¶
type PullRequestData struct {
Repo string
Number int
URL string
Title string
Body string
Author string
State string
Labels []string
Date time.Time
MergedAt *time.Time
ClosedAt *time.Time
Additions int
Deletions int
ChangedFiles int
ReviewDecision string
}
PullRequestData holds metadata for a pull request.
type ReleaseData ¶
ReleaseData holds metadata for a release authored by the user.
type RepoData ¶
type RepoData struct {
Name string
FullName string
Description string
Language string
Languages map[string]int
Stars int
Forks int
Topics []string
IsOwner bool
IsFork bool
Archived bool
License string
DefaultBranch string
OpenIssues int
CreatedAt time.Time
UpdatedAt time.Time
Commits []CommitData
PRs []PullRequestData
Reviews []ReviewData
ReviewComments []ReviewComment
PRComments []Comment
CodeSamples []CodeSample
Releases []ReleaseData
WikiPages []WikiPage
}
RepoData holds crawled data for a single repository.
type ReviewComment ¶
type ReviewComment struct {
Repo string
PRNumber int
PRTitle string
PRAuthor string
Body string
Path string
DiffHunk string
URL string
Date time.Time
}
ReviewComment holds a single PR review comment.
type ReviewData ¶
type ReviewData struct {
Repo string
PRNumber int
PRTitle string
PRAuthor string
Body string
State string
SubmittedAt time.Time
CommitID string
URL string
Labels []string
Additions int
Deletions int
ChangedFiles int
ReviewCommentCount int
}
ReviewData holds metadata for a submitted PR review.
type StarredRepo ¶
type StarredRepo struct {
Name string
FullName string
Description string
Language string
Topics []string
Stars int
}
StarredRepo holds metadata for a repository the user has starred.
type TokenPool ¶
type TokenPool struct {
// contains filtered or unexported fields
}
TokenPool distributes GitHub API requests across multiple authenticated clients using round-robin selection.
func NewTokenPool ¶
NewTokenPool creates a pool of GitHub REST clients, one per token.
type UserProfile ¶
type UserProfile struct {
Login string
Name string
Bio string
Company string
Location string
Blog string
Email string
TwitterUsername string
Hireable bool
Followers int
Following int
PublicRepos int
CreatedAt time.Time
ProfileREADME string
}
UserProfile holds GitHub profile information.