report

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package report provides report generation functionality for test results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Run          *db.Run
	Results      []*db.Result
	Plugin       string
	GeneratedAt  time.Time
	SystemInfo   SystemInfo
	MetricGroups []MetricGroup
}

Data contains all data needed for report generation

type Generator

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

Generator creates reports from test data

func NewGenerator

func NewGenerator(database *db.DB) *Generator

NewGenerator creates a new report generator

func (*Generator) GenerateHTML

func (g *Generator) GenerateHTML(runID int64) (string, error)

GenerateHTML generates an HTML report for a run

func (*Generator) GeneratePDF

func (g *Generator) GeneratePDF(runID int64, outputPath string, options *PDFOptions) error

GeneratePDF generates a PDF report for a run

func (*Generator) QuickPDF

func (g *Generator) QuickPDF(runID int64, outputPath string) error

QuickPDF generates a PDF with default options

type MetricDisplay

type MetricDisplay struct {
	Name  string
	Value string
	Unit  string
	Raw   float64
}

MetricDisplay represents a metric for display

type MetricGroup

type MetricGroup struct {
	Name    string
	Metrics []MetricDisplay
}

MetricGroup groups related metrics together

type PDFOptions

type PDFOptions struct {
	Landscape           bool
	PrintBackground     bool
	PreferCSSPageSize   bool
	PaperWidth          float64
	PaperHeight         float64
	MarginTop           float64
	MarginBottom        float64
	MarginLeft          float64
	MarginRight         float64
	HeaderTemplate      string
	FooterTemplate      string
	DisplayHeaderFooter bool
}

PDFOptions contains options for PDF generation

func DefaultPDFOptions

func DefaultPDFOptions() PDFOptions

DefaultPDFOptions returns default PDF options

type SystemInfo

type SystemInfo struct {
	Hostname     string
	OS           string
	Architecture string
	CPUModel     string
	CPUCores     int
	TotalMemory  string
}

SystemInfo contains system information

Jump to

Keyboard shortcuts

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