table

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFormats added in v0.0.3

func AllFormats() []string

Types

type Alignment added in v0.0.2

type Alignment string
const (
	AlignDefault Alignment = ""
	AlignLeft    Alignment = "left"
	AlignRight   Alignment = "right"
	AlignCenter  Alignment = "center"
)

type Format added in v0.0.3

type Format string
const (
	FormatRE      Format = "regexp"
	FormatCSV     Format = "csv"
	FormatTSV     Format = "tsv"
	FormatMK      Format = "mk"
	FormatUnknown Format = "unknown"
)

func ParseFormat added in v0.0.3

func ParseFormat(in string) (Format, error)

type NewLine

type NewLine byte
const (
	NewLineUnix NewLine = '\n'
)

type Table

type Table struct {
	TableConfig
	// contains filtered or unexported fields
}

func NewTable

func NewTable(config TableConfig) *Table

func (*Table) Read

func (t *Table) Read(r io.Reader) error

func (*Table) Write

func (t *Table) Write(w io.Writer) (int, error)

type TableConfig added in v0.0.3

type TableConfig struct {
	MaxPadding  int
	SkipHeaders bool
	Format      Format
	Alignments  map[int]Alignment
	Seperator   *regexp.Regexp
	NewLine     NewLine
}

func NewConfig added in v0.0.3

func NewConfig() TableConfig

func (TableConfig) SetFormat added in v0.0.3

func (t TableConfig) SetFormat(format Format) TableConfig

func (TableConfig) SetSeperator added in v0.0.3

func (t TableConfig) SetSeperator(in string) TableConfig

Jump to

Keyboard shortcuts

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