output

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter interface {
	WriteResults(w io.Writer, results []search.Result) error
}

Formatter writes search results to a writer.

func New

func New(format string) Formatter

New returns the formatter for the given format string.

type JSONFormatter

type JSONFormatter struct{}

JSONFormatter writes results as a JSON array.

func (*JSONFormatter) WriteResults

func (f *JSONFormatter) WriteResults(w io.Writer, results []search.Result) error

type MarkdownFormatter

type MarkdownFormatter struct{}

MarkdownFormatter writes results as a Markdown list.

func (*MarkdownFormatter) WriteResults

func (f *MarkdownFormatter) WriteResults(w io.Writer, results []search.Result) error

type TextFormatter

type TextFormatter struct{}

TextFormatter writes human-readable results.

func (*TextFormatter) WriteResults

func (f *TextFormatter) WriteResults(w io.Writer, results []search.Result) error

Jump to

Keyboard shortcuts

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