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.
Click to show internal directories.
Click to hide internal directories.