Documentation ¶
Index ¶
- type OutputFormatter
- func (t *OutputFormatter) Close(ctx context.Context, w io.Writer) error
- func (f *OutputFormatter) ContentType() string
- func (t *OutputFormatter) OutputTable(ctx context.Context, table_ *types.Table, w io.Writer) error
- func (t *OutputFormatter) RegisterRowMiddlewares(mw *middlewares.TableProcessor) error
- func (t *OutputFormatter) RegisterTableMiddlewares(mw *middlewares.TableProcessor) error
- type OutputFormatterOption
- func WithAdditionalData(additionalData interface{}) OutputFormatterOption
- func WithOutputFile(outputFile string) OutputFormatterOption
- func WithOutputFileTemplate(outputFileTemplate string) OutputFormatterOption
- func WithOutputMultipleFiles(outputMultipleFiles bool) OutputFormatterOption
- func WithTemplateFuncMaps(templateFuncMaps []template.FuncMap) OutputFormatterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OutputFormatter ¶
type OutputFormatter struct { Template string TemplateFuncMaps []template.FuncMap OutputFileTemplate string OutputMultipleFiles bool OutputFile string AdditionalData interface{} }
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) ContentType ¶ added in v0.2.84
func (f *OutputFormatter) ContentType() string
func (*OutputFormatter) OutputTable ¶ added in v0.3.1
func (*OutputFormatter) RegisterRowMiddlewares ¶ added in v0.4.13
func (t *OutputFormatter) RegisterRowMiddlewares(mw *middlewares.TableProcessor) error
func (*OutputFormatter) RegisterTableMiddlewares ¶ added in v0.3.1
func (t *OutputFormatter) RegisterTableMiddlewares(mw *middlewares.TableProcessor) error
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
Click to show internal directories.
Click to hide internal directories.