starlists

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const Name = "starlists"

Name is the canonical plugin slug.

View Source
const NavigatorKey = "_test_starlists_navigator"

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

View Source
var Plugin plugins.Plugin = &starlistsPlugin{}

Plugin is the singleton registered with the global plugin registry.

Functions

func Partial

Partial renders the classic SVG fragment for the starlists plugin. DOM contract (partial-classic-m4.md §5): emits one <g class="starlist"> per list with a <text class="starlist-name">.

Types

type Navigator interface {
	FetchLists(ctx context.Context, url string) ([]Starlist, error)
	FetchRepos(ctx context.Context, listURL string) ([]string, error)
}

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

func NewBrowserNavigator(b *render.Browser) Navigator

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.

func (*Result) IsSkipped

func (r *Result) IsSkipped() bool

IsSkipped lets the classic dispatcher detect the skipped path.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL