dumper

package
v0.0.0-...-da48874 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpKV

func DumpKV(out io.Writer, columns []string, items [][]string) error

func DumpStruct

func DumpStruct(out io.Writer, in any) error

func DumpTable

func DumpTable[T any](config TableConfig[T], out io.Writer, items []T) error

Types

type Column

type Column[K any] struct {
	Name   string
	Wide   bool
	Getter func(in *K) Row
}

type ColumnList

type ColumnList[T any] []Column[T]

type Formatted

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

func NewFormatted

func NewFormatted(format string, httpRes *http.Response, httpErr error) Formatted

func (Formatted) Dump

func (f Formatted) Dump(out io.Writer, data interface{}) error

type Row

type Row struct {
	Value  string
	Colors tablewriter.Colors
}

type TableConfig

type TableConfig[T any] struct {
	Style   TableStyle
	Wide    bool
	Columns ColumnList[T]
}

type TableStyle

type TableStyle int
const (
	TableStyleDefault TableStyle = iota
	TableStyleCSV
)

Jump to

Keyboard shortcuts

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