output

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string

Format represents the output format type

const (
	PlainFormat Format = "plain"
	JSONFormat  Format = "json"
	TermFormat  Format = "term"
)

func GetFormat

func GetFormat(s string) (Format, error)

GetFormat returns the format from string

type Formatter

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

Formatter handles output formatting

func NewFormatter

func NewFormatter(format Format, writer io.Writer) *Formatter

NewFormatter creates a new formatter

func (*Formatter) FormatError

func (f *Formatter) FormatError(err error) error

FormatError formats an error

func (*Formatter) FormatList

func (f *Formatter) FormatList(scratches []store.Scratch, showProject bool) error

FormatList formats a list of scratches

func (*Formatter) FormatPath

func (f *Formatter) FormatPath(result *commands.PathResult) error

FormatPath formats a path result

func (*Formatter) FormatSearchResults added in v1.2.0

func (f *Formatter) FormatSearchResults(results []commands.ScratchWithIndex, showProject bool) error

FormatSearchResults formats search results that include indices

func (*Formatter) FormatString

func (f *Formatter) FormatString(content string) error

FormatString formats a string output

func (*Formatter) FormatSuccess

func (f *Formatter) FormatSuccess(message string) error

FormatSuccess formats a success message

Jump to

Keyboard shortcuts

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