tablecli

package module
v0.0.0-...-7ded8a3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: BSD-3-Clause Imports: 11 Imported by: 9

README

CLI library for rendering responsive tables

This project is a library to render CLI tables. It was extracted from the tsuru project.

Features

  • Nice word wrap on largest column to fit in the terminal window;
  • Easy to use;
  • ….

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TableConfig = struct {
	BreakOnAny   bool
	ForceWrap    bool
	UseTabWriter bool
	MaxTTYWidth  int
}{
	BreakOnAny:   false,
	ForceWrap:    false,
	UseTabWriter: false,
	MaxTTYWidth:  0,
}

Functions

This section is empty.

Types

type Row

type Row []string

type Table

type Table struct {
	Headers       Row
	LineSeparator bool
	// contains filtered or unexported fields
}

func NewTable

func NewTable() *Table

func (*Table) AddRow

func (t *Table) AddRow(row Row)

func (*Table) Bytes

func (t *Table) Bytes() []byte

func (*Table) Reverse

func (t *Table) Reverse()

func (*Table) Rows

func (t *Table) Rows() int

func (*Table) Sort

func (t *Table) Sort()

Sort sorts the rows in the table using the first column as key.

func (*Table) SortByColumn

func (t *Table) SortByColumn(columns ...int)

func (*Table) String

func (t *Table) String() string

Jump to

Keyboard shortcuts

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