Documentation
¶
Overview ¶
Package report renders a probe.Result as a human-readable summary, as JSON (pretty-printed or one compact line for a JSONL dataset), or as a shields.io endpoint badge.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteBadge ¶
WriteBadge writes the shields.io endpoint JSON.
func WriteJSONLine ¶ added in v0.3.0
WriteJSONLine writes the full Result as compact, single-line JSON with a trailing newline: one row of a JSONL dataset. It uses the same encoder settings as WriteJSON (no HTML escaping), so a census record carries exactly the same fields and values `check <server> --json` prints, just without the pretty indentation a multi-line report needs and a JSONL record cannot have.
Types ¶
type Badge ¶
type Badge struct {
SchemaVersion int `json:"schemaVersion"`
Label string `json:"label"`
Message string `json:"message"`
Color string `json:"color"`
CacheSeconds int `json:"cacheSeconds"`
Server string `json:"_server,omitempty"`
CheckedAt string `json:"_checkedAt,omitempty"`
Verdict string `json:"_verdict,omitempty"`
}
Badge is the shields.io endpoint schema (schemaVersion 1). Extra underscore fields are ignored by shields.io and carried for our own embeds.
Embed: img.shields.io/endpoint?url=<hosted badge json url>