view

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 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 view prints a factorymeter/v1 report for people: as text for a terminal, as Markdown for a job summary or a pull request, and as one HTML page with charts.

It reads the report and nothing else, so anything it shows can also be read out of the JSON. The page follows the line: the verdict, the seven stations side by side, agents next to people, then each station with its history, and last what the numbers stand on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSP

func CSP() string

CSP is the content security policy of the page. It lets the page run its own style and its own script, each pinned by its hash, and nothing else: no request to any host, no frame, no form.

func Change

func Change(s *contract.Series) string

Change prints how a value moved: points for a share, percent for the rest.

func HTML

func HTML(w io.Writer, r *contract.Report, opt HTMLOptions) error

HTML writes the report as one page with its charts. The page carries its own style and script and loads nothing: it reads the same offline, from a file, and from "factorymeter serve".

func Markdown

func Markdown(w io.Writer, r *contract.Report) error

Markdown prints the report as GitHub-flavoured Markdown.

func Number

func Number(unit string, v *float64) string

Number prints a value in its unit, short enough for a table cell.

func Spark

func Spark(s *contract.Series) string

Spark draws the history of a series, one character per period. A period with nothing counted is a dot.

func Text

func Text(w io.Writer, r *contract.Report) error

Text prints the report for a terminal.

Types

type HTMLOptions

type HTMLOptions struct {
	Nav *Nav
}

HTMLOptions sets what the page shows besides the report.

type Link struct {
	Label, URL string
	Current    bool
}

Link is one choice a served page offers: a window or a repository.

type Nav struct {
	Windows []Link
	// Repos is every repository of an owner, with the whole owner first.
	Repos []Link
	// JSON is the link to the same report as factorymeter/v1 JSON.
	JSON string
}

Nav holds the links that only a served page has. A page written to a file has none: it shows one window and cannot ask for another.

Jump to

Keyboard shortcuts

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