report

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: 7 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 report constructs standardized in-memory achievement summaries combining official profile telemetry with calibrated counters.

Package report joins GitHub's official badge data with live counts into one report.

Index

Constants

View Source
const KindNew catalog.Kind = "new"

KindNew marks a badge on the profile that the catalog does not know yet.

Variables

This section is empty.

Functions

func IsWarning

func IsWarning(note string) bool

IsWarning reports whether a note says something went wrong, so every view shows it.

Types

type HighlightRow

type HighlightRow struct {
	Name   string `json:"name"`
	Earned bool   `json:"earned"`
}

HighlightRow is one profile highlight.

type Official

type Official interface {
	Profile(user string) (official.Profile, error)
	Detail(user, slug string) (*official.Detail, error)
}

Official is where GitHub's own data comes from.

type Report

type Report struct {
	User               string         `json:"user"`
	AchievementsHidden bool           `json:"achievementsHidden"`
	Authenticated      bool           `json:"authenticated"`
	CatalogVerified    string         `json:"catalogVerified"`
	Achievements       []Row          `json:"achievements"`
	Highlights         []HighlightRow `json:"highlights"`
}

Report is everything the CLI prints, and the --json output.

func Build

func Build(user string, off Official, counts counters.Source) (*Report, error)

Build makes the report for user.

type Row

type Row struct {
	Slug      string             `json:"slug"`
	Name      string             `json:"name"`
	Kind      catalog.Kind       `json:"kind"`
	HowToEarn string             `json:"howToEarn"`
	Tiers     []int              `json:"tiers"`
	Status    Status             `json:"status"`
	Tier      int                `json:"officialTier"` // GitHub's tier, 0 if not earned or hidden
	Unlocked  string             `json:"unlocked,omitempty"`
	Standing  *progress.Standing `json:"standing,omitempty"`
	Source    progress.Source    `json:"source,omitempty"`
	Notes     []string           `json:"notes,omitempty"`
	Official  *official.Detail   `json:"official,omitempty"`
	Counter   catalog.Counter    `json:"counter"`
}

Row is one achievement in the report.

type Status

type Status string

Status of a badge for this user.

const (
	Earned    Status = "earned"
	NotEarned Status = "not-earned"
	Unknown   Status = "unknown" // the profile hides achievements
)

Jump to

Keyboard shortcuts

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