presentation

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package presentation handles all UI and formatting logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorConfig

type ErrorConfig struct {
	Format    ErrorFormat
	WrapWidth int
}

ErrorConfig configures the error formatter.

type ErrorFormat

type ErrorFormat string

ErrorFormat represents the output format for errors.

const (
	// ErrorFormatText formats errors as plain text.
	ErrorFormatText ErrorFormat = "text"
	// ErrorFormatJSON formats errors as JSON.
	ErrorFormatJSON ErrorFormat = "json"
)

type ErrorFormatter

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

ErrorFormatter handles error message formatting.

func NewErrorFormatter

func NewErrorFormatter(config ErrorConfig) *ErrorFormatter

NewErrorFormatter creates a new error formatter.

func (*ErrorFormatter) FormatErrors

func (f *ErrorFormatter) FormatErrors(errors []results.ErrorDetail) (string, error)

FormatErrors formats error details based on the configured format.

func (*ErrorFormatter) FormatSummary

func (f *ErrorFormatter) FormatSummary(summary results.Summary) string

FormatSummary formats a summary message.

type HeaderConfig

type HeaderConfig struct {
	Name     any
	WidthMax int
	Bold     bool
}

HeaderConfig defines the configuration for a table header column.

type TableConfig

type TableConfig struct {
	MaxWidth int
	Verbose  bool
}

TableConfig configures the table formatter.

type TableFormatter

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

TableFormatter handles table rendering for results.

func NewTableFormatter

func NewTableFormatter(config TableConfig) *TableFormatter

NewTableFormatter creates a new table formatter.

func (*TableFormatter) RenderResults

func (f *TableFormatter) RenderResults(results []runner.Result) string

RenderResults renders a collection of results as formatted tables split by status.

Jump to

Keyboard shortcuts

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