template

package
v0.2.77 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OutputFormatter

type OutputFormatter struct {
	Template            string
	Table               *types.Table
	TemplateFuncMaps    []template.FuncMap
	OutputFileTemplate  string
	OutputMultipleFiles bool

	OutputFile     string
	AdditionalData interface{}
	// contains filtered or unexported fields
}

func NewOutputFormatter

func NewOutputFormatter(template string, opts ...OutputFormatterOption) *OutputFormatter

NewOutputFormatter creates a new OutputFormatter.

TODO(manuel, 2023-02-19) This is quite an ugly constructor signature. See: https://github.com/go-go-golems/glazed/issues/147

func (*OutputFormatter) AddRow

func (t *OutputFormatter) AddRow(row types.Row)

func (*OutputFormatter) AddTableMiddleware

func (t *OutputFormatter) AddTableMiddleware(m middlewares.TableMiddleware)

func (*OutputFormatter) AddTableMiddlewareAtIndex

func (t *OutputFormatter) AddTableMiddlewareAtIndex(i int, m middlewares.TableMiddleware)

func (*OutputFormatter) AddTableMiddlewareInFront

func (t *OutputFormatter) AddTableMiddlewareInFront(m middlewares.TableMiddleware)

func (*OutputFormatter) GetTable

func (t *OutputFormatter) GetTable() (*types.Table, error)

func (*OutputFormatter) Output

func (t *OutputFormatter) Output(ctx context.Context, w io.Writer) error

func (*OutputFormatter) SetColumnOrder

func (t *OutputFormatter) SetColumnOrder(columnOrder []types.FieldName)

type OutputFormatterOption

type OutputFormatterOption func(*OutputFormatter)

func WithAdditionalData

func WithAdditionalData(additionalData interface{}) OutputFormatterOption

func WithOutputFile

func WithOutputFile(outputFile string) OutputFormatterOption

func WithOutputFileTemplate

func WithOutputFileTemplate(outputFileTemplate string) OutputFormatterOption

func WithOutputMultipleFiles

func WithOutputMultipleFiles(outputMultipleFiles bool) OutputFormatterOption

func WithTemplateFuncMaps

func WithTemplateFuncMaps(templateFuncMaps []template.FuncMap) OutputFormatterOption

Jump to

Keyboard shortcuts

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