Documentation
¶
Index ¶
- Constants
- func CalculateSignals(repo model.RepoInfo, summary model.StargazerSummary) []model.Signal
- func ClassifyStargazer(p model.StargazerProfile) model.StargazerClass
- func ParseRepo(input string) (owner, repo string, err error)
- func Score(signals []model.Signal) (float64, model.Verdict)
- func SummarizeStargazers(profiles []model.StargazerProfile, totalStars int) model.StargazerSummary
- type GitHubClient
- type RepoAnalyzer
Constants ¶
View Source
const ( WeightForkRatio = 0.25 WeightGhostPct = 0.20 WeightStarVelocity = 0.15 WeightWatcherRatio = 0.10 WeightAccountAge = 0.10 WeightZeroFollower = 0.10 WeightIssueRatio = 0.10 )
Signal weight constants — must sum to 1.0.
Variables ¶
This section is empty.
Functions ¶
func CalculateSignals ¶
CalculateSignals computes all 7 signals from repo info and stargazer summary.
func ClassifyStargazer ¶
func ClassifyStargazer(p model.StargazerProfile) model.StargazerClass
ClassifyStargazer assigns a StargazerClass based on the profile.
func SummarizeStargazers ¶
func SummarizeStargazers(profiles []model.StargazerProfile, totalStars int) model.StargazerSummary
SummarizeStargazers builds a StargazerSummary from classified profiles.
Types ¶
type GitHubClient ¶
type GitHubClient interface {
FetchRepoInfo(ctx context.Context, owner, repo string) (model.RepoInfo, error)
FetchTotalIssues(ctx context.Context, owner, repo string) (int, error)
FetchStargazers(ctx context.Context, owner, repo string, totalStars int) ([]ghclient.StargazerEntry, error)
FetchUserProfiles(ctx context.Context, logins []string) ([]model.StargazerProfile, int)
}
GitHubClient defines the GitHub API surface needed by the analyzer.
type RepoAnalyzer ¶
type RepoAnalyzer struct {
// contains filtered or unexported fields
}
RepoAnalyzer orchestrates the full analysis pipeline for a repository.
func NewRepoAnalyzer ¶
func NewRepoAnalyzer(client GitHubClient) *RepoAnalyzer
NewRepoAnalyzer creates a new analyzer with the given GitHub client.
func (*RepoAnalyzer) Analyze ¶
func (a *RepoAnalyzer) Analyze(ctx context.Context, owner, repo string, onProgress func(string)) (model.AnalysisResult, error)
Analyze runs the full analysis pipeline on a repo.
Click to show internal directories.
Click to hide internal directories.