Documentation
¶
Overview ¶
Package tabular provides writer implementations for working with tabular output for display
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TextTableWriter ¶
type TextTableWriter struct {
// contains filtered or unexported fields
}
TextTableWriter implements TableWriter. It writes table headers and rows as ascii-art tables. The first row written must be the column names for the table to write, and all rows written are assumed to have the same width for their respective columns (including the column names themselves). Values for all columns in the schema must be set on each row.
func NewTextTableWriter ¶
func NewTextTableWriter(wr io.WriteCloser, sch schema.Schema) (*TextTableWriter, error)
NewTextTableWriter writes rows to the given WriteCloser based on the Schema provided, with a single table header row. The schema must contain only string type columns.
func NewTextTableWriterWithNumHeaderRows ¶
func NewTextTableWriterWithNumHeaderRows(wr io.WriteCloser, sch schema.Schema, numHeaderRows int) (*TextTableWriter, error)
NewTextTableWriterWithNumHeaderRows writes rows to the given WriteCloser based on the Schema provided, with the first numHeaderRows rows in the table header. The schema must contain only string type columns.
func (*TextTableWriter) Close ¶
func (ttw *TextTableWriter) Close(ctx context.Context) error
Close should flush all writes, release resources being held
func (*TextTableWriter) GetSchema ¶
func (ttw *TextTableWriter) GetSchema() schema.Schema
GetSchema gets the schema of the rows that this writer writes