formatters

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeOutputFilename added in v0.2.58

func ComputeOutputFilename(
	outputFile string,
	outputFileTemplate string,
	row types.Row,
	index int,
) (string, error)

Types

type OutputFormatter

type OutputFormatter interface {
	// RegisterTableMiddlewares allows individual OutputFormatters to register middlewares that might be
	// necessary for them to do the proper output. For example, table and excel output require
	// flattening the row objects before output.
	RegisterTableMiddlewares(mw *middlewares.TableProcessor) error
	RegisterRowMiddlewares(mw *middlewares.TableProcessor) error
	ContentType() string
	Close(ctx context.Context, w io.Writer) error
}

type RowOutputFormatter added in v0.3.0

type RowOutputFormatter interface {
	OutputFormatter
	OutputRow(ctx context.Context, row types.Row, w io.Writer) error
}

type TableOutputFormatter

type TableOutputFormatter interface {
	OutputFormatter
	OutputTable(ctx context.Context, table *types.Table, w io.Writer) error
}

TableOutputFormatter is an output formatter that requires an entire table to be computed up front before it can be output.

NOTE(manuel, 2023-06-28) Since this is actually the first type of Formatter that was implemented, it is the current de facto standard. RowOutputFormatter has been added later and is thus not in wide spread use.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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