json

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(t tabular.Table) (string, error)

Render takes a tabular.Table and creates a default options JSONTable object and then calls the Render method upon it.

func RenderTo

func RenderTo(t tabular.Table, w io.Writer) error

RenderTo takes a tabular.Table and creates a default options JSONTable object and calls the RenderTo method upon it.

Types

type JSONTable

type JSONTable struct {
	tabular.Table
}

A JSONTable wraps a tabular.Table to act as a render control for JSON output.

func New

func New() *JSONTable

New returns a JSONTable with a new Table inside it, access via .Table or just use the interface methods on the JSONTable.

func Wrap

func Wrap(t tabular.Table) *JSONTable

Wrap returns a JSONTable rendering object for the given tabular.Table.

func (*JSONTable) Render

func (jt *JSONTable) Render() (string, error)

Render takes a tabular Table and returns a string representing the fully rendered table or an error.

func (*JSONTable) RenderTo

func (jt *JSONTable) RenderTo(w io.Writer) error

RenderTo writes the table to the provided writer, stopping if it encounters an error.

Jump to

Keyboard shortcuts

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