output

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset  = "\033[0m"
	Red    = "\033[31m"
	Green  = "\033[32m"
	Yellow = "\033[33m"
	Blue   = "\033[34m"
	Gray   = "\033[90m"
)

Color codes for terminal output

Variables

This section is empty.

Functions

This section is empty.

Types

type Colorizer

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

Colorizer handles color output

func NewColorizer

func NewColorizer(colorSetting string) *Colorizer

NewColorizer creates a new colorizer based on the color setting

func (*Colorizer) Blue

func (c *Colorizer) Blue(text string) string

Blue returns text in blue

func (*Colorizer) Color

func (c *Colorizer) Color(text, colorCode string) string

Color wraps text with ANSI color codes if enabled

func (*Colorizer) Gray

func (c *Colorizer) Gray(text string) string

Gray returns text in gray

func (*Colorizer) Green

func (c *Colorizer) Green(text string) string

Green returns text in green

func (*Colorizer) IsEnabled

func (c *Colorizer) IsEnabled() bool

IsEnabled returns whether coloring is enabled

func (*Colorizer) Red

func (c *Colorizer) Red(text string) string

Red returns text in red

func (*Colorizer) Yellow

func (c *Colorizer) Yellow(text string) string

Yellow returns text in yellow

type Formatter

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

Formatter handles output formatting

func NewFormatter

func NewFormatter(colorSetting string, verbose bool) *Formatter

NewFormatter creates a new output formatter

func (*Formatter) FormatMessage

func (f *Formatter) FormatMessage(w io.Writer, level, message string)

FormatMessage formats a generic message

func (*Formatter) FormatResult

func (f *Formatter) FormatResult(w io.Writer, format string, results []validator.Result, filename string)

FormatResult formats and writes validation results to the output

Jump to

Keyboard shortcuts

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