Documentation
¶
Index ¶
- type Client
- func (c *Client) FetchRepoInfo(ctx context.Context, owner, repo string) (model.RepoInfo, error)
- func (c *Client) FetchStargazers(ctx context.Context, owner, repo string, totalStars int) ([]StargazerEntry, error)
- func (c *Client) FetchTotalIssues(ctx context.Context, owner, repo string) (int, error)
- func (c *Client) FetchUserProfile(ctx context.Context, login string) (model.StargazerProfile, error)
- func (c *Client) FetchUserProfiles(ctx context.Context, logins []string) ([]model.StargazerProfile, int)
- type ProfileResult
- type StargazerEntry
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 wraps the GitHub API with rate-limit handling and stargazer sampling.
func NewClientWith ¶
NewClientWith creates a Client with an injected go-github client (for testing).
func (*Client) FetchRepoInfo ¶
FetchRepoInfo retrieves basic repository statistics.
func (*Client) FetchStargazers ¶
func (c *Client) FetchStargazers(ctx context.Context, owner, repo string, totalStars int) ([]StargazerEntry, error)
FetchStargazers retrieves stargazers with timestamps. For repos with <= maxStargazersFullScan stars, fetches all. For larger repos, samples pages randomly to get ~sampleSize entries.
func (*Client) FetchTotalIssues ¶
FetchTotalIssues returns the total number of issues (open + closed) via search.
func (*Client) FetchUserProfile ¶
func (c *Client) FetchUserProfile(ctx context.Context, login string) (model.StargazerProfile, error)
FetchUserProfile fetches a user's profile for stargazer classification.
func (*Client) FetchUserProfiles ¶
func (c *Client) FetchUserProfiles(ctx context.Context, logins []string) ([]model.StargazerProfile, int)
FetchUserProfiles fetches profiles for multiple users with concurrency control. Returns only successfully fetched profiles and the count of failures.
type ProfileResult ¶
type ProfileResult struct {
Profile model.StargazerProfile
Err error
}
ProfileResult pairs a successfully fetched profile with its error state.
type StargazerEntry ¶
StargazerEntry pairs a login with the time they starred.