unixtable

package module
v0.0.0-...-38d5248 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 9 Imported by: 1

README

go-encoding-unixtable CI godoc goreportcard license

Go module to encode unixtable with a similar API to the Go standard library's encoding/json.

Id   Name               Age
1    Obi-Wan Kenobi     35
2    General Grievous   50

Useful for displaying CLI output (think kubectl get pods).

install

go get github.com/frantjc/go-encoding-unixtable

use

See example.

Documentation

Index

Constants

View Source
const (
	Tag = "unixtable"
)

Variables

View Source
var ErrInvalidInput = errors.New("invalid input")
View Source
var ErrTypeNotSupported = errors.New("type not supported")

Functions

func Marshal

func Marshal(a any) ([]byte, error)

Types

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(v any) error

type Encoder

type Encoder struct {
	*tabwriter.Writer
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(a any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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