Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeOutputFilename ¶ added in v0.2.58
func StartFormatIntoChannel ¶ added in v0.2.82
func StartFormatIntoChannel[T interface{ ~string }](
ctx context.Context,
formatter OutputFormatter,
) <-chan T
StartFormatIntoChannel outputs the data from an OutputFormatter into a channel. This is useful to render a table into a stream, for example when rendering larger outputs into HTML when serving.
Types ¶
type OutputFormatter ¶
type OutputFormatter interface {
// TODO(manuel, 2022-11-12) We need to be able to output to a directory / to a stream / to multiple files
AddRow(row types.Row)
SetColumnOrder(columnOrder []types.FieldName)
// AddTableMiddleware adds a middleware at the end of the processing list
AddTableMiddleware(m middlewares.TableMiddleware)
AddTableMiddlewareInFront(m middlewares.TableMiddleware)
AddTableMiddlewareAtIndex(i int, m middlewares.TableMiddleware)
GetTable() (*types.Table, error)
Output(ctx context.Context, w io.Writer) error
ContentType() string
}
Click to show internal directories.
Click to hide internal directories.