Documentation ¶
Overview ¶
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.
Index ¶
- Constants
- type Column
- type TableField
- type TableOutputFormat
- type TablePrinter
- type TablePrinterOption
- func WithFieldTruncateFunc(truncateFunc func(int, string) string) TablePrinterOption
- func WithMaxWidth(maxWidth int) TablePrinterOption
- func WithOutputFormat(format TableOutputFormat) TablePrinterOption
- func WithOutputFormatFromString(format string) TablePrinterOption
- func WithTableDelimeter(delim string) TablePrinterOption
Constants ¶
const ( OutputFormatTable = TableOutputFormat("table") OutputFormatJSON = TableOutputFormat("json") OutputFormatYAML = TableOutputFormat("yaml") OutputFormatList = TableOutputFormat("list") DefaultDelimeter = " " )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TableField ¶ added in v0.6.1
type TableField struct {
// contains filtered or unexported fields
}
func (*TableField) DisplayWidth ¶ added in v0.6.1
func (f *TableField) DisplayWidth() int
type TableOutputFormat ¶ added in v0.6.1
type TableOutputFormat string
type TablePrinter ¶
type TablePrinter struct {
// contains filtered or unexported fields
}
func NewTablePrinter ¶
func NewTablePrinter(ctx context.Context, topts ...TablePrinterOption) (*TablePrinter, error)
NewTablePrinter returns a pointer instance of TablePrinter struct.
type TablePrinterOption ¶ added in v0.6.1
type TablePrinterOption func(*TablePrinter) error
TablePrinterOption is a type of func(*TablePrinter).
func WithFieldTruncateFunc ¶ added in v0.6.1
func WithFieldTruncateFunc(truncateFunc func(int, string) string) TablePrinterOption
WithFieldTruncateFunc returns a function func(opts *TablePrinter) that sets `truncateFunc` in TablePrinter pointer instance.
func WithMaxWidth ¶ added in v0.6.1
func WithMaxWidth(maxWidth int) TablePrinterOption
WithMaxWidth returns a function func(opts *TablePrinter) that sets `maxWidth` in TablePrinter pointer instance.
func WithOutputFormat ¶ added in v0.6.1
func WithOutputFormat(format TableOutputFormat) TablePrinterOption
WithOutputFormat returns a function func(opts *TablePrinter) that sets `format` in TablePrinter pointer instance.
func WithOutputFormatFromString ¶ added in v0.6.1
func WithOutputFormatFromString(format string) TablePrinterOption
WithOutputFormatFromString returns a function func(opts *TablePrinter) that sets `format` in TablePrinter pointer instance of type `TableOutputFormat` from string.
func WithTableDelimeter ¶ added in v0.6.1
func WithTableDelimeter(delim string) TablePrinterOption
WithTableDelimeter returns a function func(opts *TablePrinter) that sets `delimeter` in TablePrinter pointer instance.