reporting

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 28 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

Index

Constants

View Source
const MaxRenderedBytes = 64 << 20

Variables

This section is empty.

Functions

func BuildDocument

func BuildDocument(report runs.Report) []runs.ReportNode

BuildDocument is the sole semantic projection used by all export renderers. Every string remains text; protocol bodies are never decoded as JS numbers.

func GroupID

func GroupID(node runs.ReportNode) string

func Markdown

func Markdown(report runs.Report) (string, error)

func PDF

func PDF(ctx context.Context, assets fs.FS, r runs.Report) ([]byte, error)

func Plain

func Plain(report runs.Report) string

func StepLabel

func StepLabel(status string) string

func TableLines

func TableLines(node runs.ReportNode) []string

func Value

func Value(v catalog.TypedValue) string

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache() *Cache

func (*Cache) Get

func (c *Cache) Get(id, hash, runID string, expected bool) (runs.Report, error)

func (*Cache) Put

func (c *Cache) Put(report *runs.Report) error

type CaseExport added in v1.0.1

type CaseExport struct {
	TestCaseID string `json:"testCaseId"`
	Revision   int64  `json:"revision"`
	Format     string `json:"format"`
	Text       string `json:"text"`
	SHA256     string `json:"sha256"`
}

func ExportCase added in v1.0.1

func ExportCase(ctx context.Context, repo ports.Catalog, id string, revision int64, includeExpected bool) (CaseExport, error)

type ClipboardResult

type ClipboardResult struct {
	Copied bool `json:"copied"`
	Native bool `json:"native"`
}

type ClipboardWrite

type ClipboardWrite struct {
	SnapshotID      string    `json:"snapshotId"`
	Hash            string    `json:"hash"`
	IncludeExpected bool      `json:"includeExpected"`
	Parts           []PNGPart `json:"parts"`
}

type File

type File struct {
	Name, MIMEType string
	Data           []byte
}

func Render

func Render(ctx context.Context, assets fs.FS, r runs.Report, format string) ([]File, error)

type PNGPart

type PNGPart struct {
	GroupID    string `json:"groupId"`
	Part       int    `json:"part"`
	Total      int    `json:"total"`
	DataBase64 string `json:"dataBase64"`
}

func CallPNGs

func CallPNGs(ctx context.Context, assets fs.FS, r runs.Report) ([]PNGPart, error)

type Reference

type Reference struct {
	RunID           string `json:"runId"`
	SnapshotID      string `json:"snapshotId"`
	Hash            string `json:"hash"`
	IncludeExpected bool   `json:"includeExpected"`
}

type RichContent

type RichContent struct{ Text, HTML, RTF string }

func Rich

func Rich(report runs.Report, parts []PNGPart) (RichContent, error)

type Service

type Service struct {
	Cache           *Cache
	Runs            ports.Runs
	Catalog         ports.Catalog
	Assets          fs.FS
	ClipboardNative bool
	// contains filtered or unexported fields
}

func NewService

func NewService(r ports.Runs, c ports.Catalog, assets fs.FS, native bool) *Service

func (*Service) Cached

func (s *Service) Cached(ref Reference) (runs.Report, error)

func (*Service) Export

func (s *Service) Export(ctx context.Context, ref Reference, format string) ([]File, error)

func (*Service) Prepare

func (s *Service) Prepare(ctx context.Context, id string, expected bool) (runs.Report, error)

func (*Service) WithReport

func (s *Service) WithReport(ctx context.Context, ref Reference, apply func(context.Context, runs.Report) ([]File, error)) ([]File, error)

Jump to

Keyboard shortcuts

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