formats

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVFormatter

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

CSVFormatter is a formatter for CSV reports

func NewCSVFormatter

func NewCSVFormatter(delimiter rune, includeHeaders bool) *CSVFormatter

NewCSVFormatter creates a new CSV formatter

func (*CSVFormatter) Format

func (f *CSVFormatter) Format(ctx context.Context, reportInterface interface{}, optionsInterface interface{}) ([]byte, error)

Format formats a report as CSV

func (*CSVFormatter) FormatReport

func (f *CSVFormatter) FormatReport(results api.TestResults, writer io.Writer) error

FormatReport formats a report and writes it to the given writer

func (*CSVFormatter) GetFormat

func (f *CSVFormatter) GetFormat() api.ReportFormat

GetFormat returns the format supported by this formatter

func (*CSVFormatter) WriteToFile

func (f *CSVFormatter) WriteToFile(ctx context.Context, reportInterface interface{}, optionsInterface interface{}, filePath string) error

WriteToFile writes a report to a file

type ExcelFormatter

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

ExcelFormatter is a formatter for Excel reports

func NewExcelFormatter

func NewExcelFormatter(includeRawData bool) *ExcelFormatter

NewExcelFormatter creates a new Excel formatter

func (*ExcelFormatter) Format

func (f *ExcelFormatter) Format(ctx context.Context, reportInterface interface{}, optionsInterface interface{}) ([]byte, error)

Format formats a report as Excel

func (*ExcelFormatter) FormatReport

func (f *ExcelFormatter) FormatReport(results api.TestResults, writer io.Writer) error

FormatReport formats a report and writes it to the given writer

func (*ExcelFormatter) GetFormat

func (f *ExcelFormatter) GetFormat() api.ReportFormat

GetFormat returns the format supported by this formatter

func (*ExcelFormatter) WriteToFile

func (f *ExcelFormatter) WriteToFile(ctx context.Context, reportInterface interface{}, optionsInterface interface{}, filePath string) error

WriteToFile writes a report to a file

type HTMLFormatter

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

HTMLFormatter is a formatter for HTML reports

func NewHTMLFormatter

func NewHTMLFormatter() (*HTMLFormatter, error)

NewHTMLFormatter creates a new HTML formatter with the default template

func NewHTMLFormatterWithTemplate

func NewHTMLFormatterWithTemplate(templatePath string) (*HTMLFormatter, error)

NewHTMLFormatterWithTemplate creates a new HTML formatter with a custom template

func (*HTMLFormatter) Format

func (f *HTMLFormatter) Format(ctx context.Context, reportInterface interface{}, optionsInterface interface{}) ([]byte, error)

Format formats a report as HTML

func (*HTMLFormatter) FormatReport

func (f *HTMLFormatter) FormatReport(results api.TestResults, writer io.Writer) error

FormatReport formats a report and writes it to the given writer

func (*HTMLFormatter) GetFormat

func (f *HTMLFormatter) GetFormat() api.ReportFormat

GetFormat returns the format supported by this formatter

func (*HTMLFormatter) WriteToFile

func (f *HTMLFormatter) WriteToFile(ctx context.Context, reportInterface interface{}, optionsInterface interface{}, filePath string) error

WriteToFile writes a report to a file

type JSONFormatter

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

JSONFormatter is a formatter for JSON reports

func NewJSONFormatter

func NewJSONFormatter(pretty bool) *JSONFormatter

NewJSONFormatter creates a new JSON formatter

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(ctx context.Context, reportInterface interface{}, optionsInterface interface{}) ([]byte, error)

Format formats a report as JSON

func (*JSONFormatter) FormatReport

func (f *JSONFormatter) FormatReport(results api.TestResults, writer io.Writer) error

FormatReport formats a report and writes it to the given writer

func (*JSONFormatter) GetFormat

func (f *JSONFormatter) GetFormat() api.ReportFormat

GetFormat returns the format supported by this formatter

func (*JSONFormatter) WriteToFile

func (f *JSONFormatter) WriteToFile(ctx context.Context, reportInterface interface{}, optionsInterface interface{}, filePath string) error

WriteToFile writes a report to a file

type JSONLFormatter

type JSONLFormatter struct{}

JSONLFormatter is a formatter for JSONL reports

func NewJSONLFormatter

func NewJSONLFormatter() *JSONLFormatter

NewJSONLFormatter creates a new JSONL formatter

func (*JSONLFormatter) Format

func (f *JSONLFormatter) Format(ctx context.Context, reportInterface interface{}, optionsInterface interface{}) ([]byte, error)

Format formats a report as JSONL

func (*JSONLFormatter) FormatReport

func (f *JSONLFormatter) FormatReport(results api.TestResults, writer io.Writer) error

FormatReport formats a report and writes it to the given writer

func (*JSONLFormatter) GetFormat

func (f *JSONLFormatter) GetFormat() api.ReportFormat

GetFormat returns the format supported by this formatter

func (*JSONLFormatter) WriteToFile

func (f *JSONLFormatter) WriteToFile(ctx context.Context, reportInterface interface{}, optionsInterface interface{}, filePath string) error

WriteToFile writes a report to a file

type MarkdownFormatter

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

MarkdownFormatter is a formatter for Markdown reports

func NewMarkdownFormatter

func NewMarkdownFormatter(includeRawData bool) *MarkdownFormatter

NewMarkdownFormatter creates a new Markdown formatter

func (*MarkdownFormatter) Format

func (f *MarkdownFormatter) Format(ctx context.Context, reportInterface interface{}, optionsInterface interface{}) ([]byte, error)

Format formats a report as Markdown

func (*MarkdownFormatter) FormatReport

func (f *MarkdownFormatter) FormatReport(results api.TestResults, writer io.Writer) error

FormatReport formats a report and writes it to the given writer

func (*MarkdownFormatter) GetFormat

func (f *MarkdownFormatter) GetFormat() api.ReportFormat

GetFormat returns the format supported by this formatter

func (*MarkdownFormatter) WriteToFile

func (f *MarkdownFormatter) WriteToFile(ctx context.Context, reportInterface interface{}, optionsInterface interface{}, filePath string) error

WriteToFile writes a report to a file

type PDFFormatter

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

PDFFormatter is a formatter for PDF reports

func NewPDFFormatter

func NewPDFFormatter(customTemplate string) *PDFFormatter

NewPDFFormatter creates a new PDF formatter

func (*PDFFormatter) Format

func (f *PDFFormatter) Format(ctx context.Context, reportInterface interface{}, optionsInterface interface{}) ([]byte, error)

Format formats a report as PDF

func (*PDFFormatter) FormatReport

func (f *PDFFormatter) FormatReport(results api.TestResults, writer io.Writer) error

FormatReport formats a report and writes it to the given writer

func (*PDFFormatter) GetFormat

func (f *PDFFormatter) GetFormat() api.ReportFormat

GetFormat returns the format supported by this formatter

func (*PDFFormatter) WriteToFile

func (f *PDFFormatter) WriteToFile(ctx context.Context, reportInterface interface{}, optionsInterface interface{}, filePath string) error

WriteToFile writes a report to a file

type TextFormatter

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

TextFormatter is a formatter for plain text reports

func NewTextFormatter

func NewTextFormatter(detailed bool) *TextFormatter

NewTextFormatter creates a new text formatter

func (*TextFormatter) Format

func (f *TextFormatter) Format(ctx context.Context, reportInterface interface{}, optionsInterface interface{}) ([]byte, error)

Format formats a report as plain text

func (*TextFormatter) FormatReport

func (f *TextFormatter) FormatReport(results api.TestResults, writer io.Writer) error

FormatReport formats a report and writes it to the given writer

func (*TextFormatter) GetFormat

func (f *TextFormatter) GetFormat() api.ReportFormat

GetFormat returns the format supported by this formatter

func (*TextFormatter) WriteToFile

func (f *TextFormatter) WriteToFile(ctx context.Context, reportInterface interface{}, optionsInterface interface{}, filePath string) error

WriteToFile writes a report to a file

Directories

Path Synopsis
Package types provides common types for the reporting formatters
Package types provides common types for the reporting formatters

Jump to

Keyboard shortcuts

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