format

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONFormat     = "json"
	TableFormat    = "table"
	VerticalFormat = "vertical"
)

Variables

This section is empty.

Functions

func Apply added in v0.0.18

func Apply(format Format, options Options, input *Data) (string, error)

func JSON

func JSON(input *Data) string

func Table

func Table(input *Data, options Options) string

func Vertical added in v0.0.18

func Vertical(input *Data) string

Types

type Data

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

func NewData

func NewData() *Data

func (*Data) AddColumn

func (d *Data) AddColumn(column interface{})

func (*Data) AddRow

func (d *Data) AddRow(row []interface{})

func (*Data) GetColumns

func (d *Data) GetColumns() []interface{}

func (*Data) GetRows

func (d *Data) GetRows() [][]interface{}

type Format

type Format string

func (*Format) Set

func (f *Format) Set(s string) error

func (*Format) String

func (f *Format) String() string

func (*Format) Type

func (f *Format) Type() string

type Options added in v0.1.4

type Options struct {
	NoHeaders bool
}

Jump to

Keyboard shortcuts

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