cliformat

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IteratorFormatter

type IteratorFormatter[T any] interface {
	Format(context.Context, io.Writer, iterator.Iterator[T]) error
}

IteratorFormatter defines the basic Iterator formatting method Format.

func JSON

func JSON[T any]() IteratorFormatter[T]

JSON returns an IteratorFormatter that formats elements into JSON objects.

func Table

func Table[T any](fields []string) IteratorFormatter[T]

Table returns an IteratorFormatter that formats elements into a table of the given fields.

func Template

func Template[T any](tmpl string) (IteratorFormatter[T], error)

Template returns an IteratorFormatter that formats elements according to the given Go text/template template. See https://pkg.go.dev/text/template for more details.

Jump to

Keyboard shortcuts

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