formatter

package
v0.0.0-...-3a06bfb Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder[T any] interface {
	// contains filtered or unexported methods
}

type EncoderBuilder

type EncoderBuilder[T any] interface {
	// contains filtered or unexported methods
}

type Field

type Field[T any] struct {
	Name   string
	Header string
	// whether to show by default
	Show   bool
	Getter func(T) any
}

type FlushWriter

type FlushWriter interface {
	io.Writer
	Flush() error
}

type Formatter

type Formatter[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](fields []*Field[T], tmpl string, humanized bool) *Formatter[T]

func (*Formatter[T]) Exec

func (f *Formatter[T]) Exec(out io.Writer, data []T) error

func (*Formatter[T]) ExecIter

func (f *Formatter[T]) ExecIter(out io.Writer, it iter.Ator[T]) error

type Humanizer

type Humanizer interface {
	FmtHumanize() string
}

type Provider

type Provider[T any] interface {
	ProvideFmtMetadata() []Field[T]
}

type Stringer

type Stringer interface {
	FmtString() string
}

Jump to

Keyboard shortcuts

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