fixtures

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 8 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 fixtures serves the real github.com pages saved under internal/official/testdata, for tests and for the README demo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir() string

Dir is the fixture directory, found relative to this file so it works from any package.

func Read

func Read(user, name string) (string, bool, error)

Read returns a fixture page, or false when there is none.

Types

type Counts

type Counts struct {
	Authed     bool
	PRs        counters.MergedPRs
	Owned      int
	OwnedRepo  string
	RepoStar   map[string]int
	RepoErr    map[string]error // RepoStars fails for these
	FactsValue *counters.Facts
}

Counts is a counters.Source with fixed answers.

func TorvaldsDemo

func TorvaldsDemo() *Counts

TorvaldsDemo is the README demo: @torvalds's real official pages, with counts fixed at the values the live CLI returned on the catalog's verification date.

func (*Counts) Facts

func (c *Counts) Facts(string, []string) (*counters.Facts, error)

func (*Counts) IsAuthenticated

func (c *Counts) IsAuthenticated() bool

func (*Counts) MaxOwnedStars

func (c *Counts) MaxOwnedStars(string) (int, string, error)

func (*Counts) MergedPRs

func (c *Counts) MergedPRs(string) (counters.MergedPRs, error)

func (*Counts) RepoStars

func (c *Counts) RepoStars(repo string) (int, error)

type Official

type Official struct{}

Official answers like github.com, from fixtures.

func (Official) Detail

func (Official) Detail(user, slug string) (*official.Detail, error)

func (Official) Profile

func (Official) Profile(user string) (official.Profile, error)

Jump to

Keyboard shortcuts

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