table

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnsChannelMiddleware added in v0.3.6

type ColumnsChannelMiddleware struct {
	// contains filtered or unexported fields
}

func NewColumnsChannelMiddleware added in v0.3.6

func NewColumnsChannelMiddleware(c chan<- []types.FieldName) *ColumnsChannelMiddleware

func (*ColumnsChannelMiddleware) Close added in v0.3.6

func (*ColumnsChannelMiddleware) Process added in v0.3.6

func (c *ColumnsChannelMiddleware) Process(ctx context.Context, table *types.Table) (*types.Table, error)

type NullTableMiddleware added in v0.3.3

type NullTableMiddleware struct{}

The NullTableMiddleware is only used to keep rows in the TableProcessor.Table.

func (*NullTableMiddleware) Close added in v0.3.3

func (n *NullTableMiddleware) Close(ctx context.Context) error

func (*NullTableMiddleware) Process added in v0.3.3

func (n *NullTableMiddleware) Process(ctx context.Context, table *types.Table) (*types.Table, error)

type OutputChannelMiddleware added in v0.3.6

type OutputChannelMiddleware[T interface{ ~string }] struct {
	// contains filtered or unexported fields
}

func NewOutputChannelMiddleware added in v0.3.6

func NewOutputChannelMiddleware[T interface{ ~string }](formatter formatters.RowOutputFormatter,
	c chan<- T) *OutputChannelMiddleware[T]

func (*OutputChannelMiddleware[T]) Close added in v0.3.6

func (o *OutputChannelMiddleware[T]) Close(ctx context.Context) error

func (*OutputChannelMiddleware[T]) Process added in v0.3.6

func (o *OutputChannelMiddleware[T]) Process(ctx context.Context, table *types.Table) (*types.Table, error)

type OutputMiddleware added in v0.3.1

type OutputMiddleware struct {
	// contains filtered or unexported fields
}

func NewOutputMiddleware added in v0.3.1

func NewOutputMiddleware(formatter formatters.TableOutputFormatter, writer io.Writer) *OutputMiddleware

func (*OutputMiddleware) Close added in v0.3.1

func (o *OutputMiddleware) Close(ctx context.Context) error

func (*OutputMiddleware) Process added in v0.3.1

func (o *OutputMiddleware) Process(ctx context.Context, table *types.Table) (*types.Table, error)

type SortByMiddleware

type SortByMiddleware struct {
	// contains filtered or unexported fields
}

SortByMiddleware sorts the table by the given columns, in ascending or descending order. If the column contains rows with the same type, the order is undefined.

func NewSortByMiddlewareFromColumns

func NewSortByMiddlewareFromColumns(columns ...string) *SortByMiddleware

NewSortByMiddlewareFromColumns creates a new SortByMiddleware from the given columns. To sort in descending order, prefix the column name with a minus sign.

Example:

NewSortByMiddlewareFromColumns("name", "-age")

This will sort by name in ascending order and by age in descending order.

func (*SortByMiddleware) Close added in v0.3.1

func (s *SortByMiddleware) Close(ctx context.Context) error

func (*SortByMiddleware) Process

func (s *SortByMiddleware) Process(ctx context.Context, table *types.Table) (*types.Table, error)

Jump to

Keyboard shortcuts

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