Documentation
¶
Overview ¶
Package starlists owns the M4 "starlists" plugin. It scrapes the user's starred-lists landing page + each list's detail page via chromedp because the GitHub API does not expose starlists.
Contracts: specs/004-m4-github-plugins/contracts/plugin-p3-heavy.md §4 Data model: specs/004-m4-github-plugins/data-model.md E-024
Same Navigator-based test seam as the topics plugin: production chromedp scraping is isolated behind the Navigator interface so non- chromedp tests can exercise the skipped/short-circuit paths.
Index ¶
Constants ¶
const Name = "starlists"
Name is the canonical plugin slug.
NavigatorKey is the inputs map slot tests use to inject a fake Navigator. Production code never sets this — the plugin falls back to pc.Render.
Variables ¶
var Plugin plugins.Plugin = &starlistsPlugin{}
Plugin is the singleton registered with the global plugin registry.
Functions ¶
Types ¶
type Navigator ¶
type Navigator interface {
}
Navigator abstracts the chromedp interactions so non-chromedp tests can inject a fake. The Fetch method returns the list overview; the FetchRepos method drills into a single list to enumerate its repos for language analysis.
func NewBrowserNavigator ¶
NewBrowserNavigator returns a production Navigator. Exposed for chromedp-tagged tests that want to drive the real scrape path against a local fixture server.
type Result ¶
type Result struct {
Skipped bool `json:"skipped,omitempty"`
SkippedReason string `json:"-"`
List []Starlist `json:"list"`
Languages bool `json:"languages,omitempty"`
}
Result is the JSON payload published under data.Plugins["starlists"]. Field set mirrors data-model E-024.
type Starlist ¶
type Starlist struct {
Name string `json:"name"`
Description string `json:"description"`
Count int `json:"count"`
Languages []plugins.LanguageStat `json:"languages,omitempty"`
URL string `json:"-"` // internal: used by language analysis
Repos []string `json:"-"` // internal: repos extracted from detail page
}
Starlist is one starlist entry. When the user requested per-list language analysis (_languages=true), Languages holds the aggregated breakdown across the list's repositories.