write

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format int
const (
	None Format = iota
	Table
	Json
	Csv
	Yaml
)

func FormatOfName

func FormatOfName(name string) (Format, bool)

func FormatOfValue

func FormatOfValue(value int) (Format, bool)

func (Format) Index

func (t Format) Index() int

Index - Index value

func (Format) String

func (t Format) String() string

String - Name

type TableData

type TableData interface {
	Array() [][]string
}

type Writer

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

func New

func New(w io.Writer, f Format) *Writer

func NewStd

func NewStd() *Writer

func (*Writer) Csv

func (r *Writer) Csv(records [][]string) error

func (*Writer) Json

func (r *Writer) Json(v any) error

func (*Writer) MustWrite

func (r *Writer) MustWrite(data TableData)

func (*Writer) Printf

func (r *Writer) Printf(s string, a ...any) (n int, err error)

func (*Writer) Table

func (r *Writer) Table(records [][]string) error

func (*Writer) Write

func (r *Writer) Write(data TableData) error

func (*Writer) Yaml

func (r *Writer) Yaml(v any) error

Jump to

Keyboard shortcuts

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