auto

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: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListStyles

func ListStyles() []string

ListStyles returns a sorted list of strings, where each string is a valid input to the New function. The list is not exhaustive, sub-styles may be either included or omitted; the results should be sufficiently representative to be used by help systems for listing available styles, without having to go into every possible mutation.

func Render

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

Render takes a tabular.Table and a style and creates a default-options object of the type indicated by the style, with any tuning options from that style applied, and then calls the Render method upon it.

func RenderTo

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

RenderTo takes a tabular.Table and a style and creates a default-options object of the type indicated by the style, with any tuning options from that style applied, and then calls the RenderTo method upon it. API considers the style to be a decoration/refinement and places that parameter last.

Types

type RenderTable

type RenderTable interface {
	tabular.Table
	Render() (string, error)
	RenderTo(io.Writer) error
}

Any table sub-package which can be rendered should meet this interface.

func New

func New(style string) RenderTable

New creates a new tabular.Table and Wrap()s it.

func Wrap

func Wrap(t tabular.Table, style string) RenderTable

Wrap takes a tabular.Table and a style string. While Wrap returns the RenderTable interface, the type underlying that interface is dependent upon the contents of the style string.

The style is a dot (period) separated sequence of fields, but will usually just be a single field with no dot. The first section is either the name of a sub-package, or a known registered decoration of texttable. Wrap(t, "texttable.utf8-light") is the same as Wrap(t, "utf8-light").

The style sections after the first are interpreted dependent upon the first section and not yet locked down by API.

Jump to

Keyboard shortcuts

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