textformatter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package textformatter is the yaff Text formatter.

Index

Constants

View Source
const Text = yaff.Format("text")

Text format.

Variables

This section is empty.

Functions

func NewFormatter

func NewFormatter() (yaff.Formatter, error)

NewFormatter return a new formatter.

Types

type Options

type Options struct {
	Style           TableStyle
	ExcludeHeader   bool
	ColumnSeparator string
	ColumnSet       map[string]bool
	ExcludeSet      map[string]bool
	// TerminalWidth is the width oth the terminal the aligned text is being output to
	// if this is 0 no wrapping will be used.  For values > column min width this value will
	// be used to wrap text.
	TerminalWidth int
}

Options for the JSON formatter.

func NewOptions

func NewOptions() Options

NewOptions return new options.

type TableStyle

type TableStyle int

TableStyle is the style of the output table.

const (
	// Plain text.
	Plain TableStyle = iota

	// Aligned in columns.
	Aligned

	// Grid surrounding.
	Grid

	// Markdown uses a markdown table format.
	Markdown
)

func GetTextStyleFromString

func GetTextStyleFromString(style string) (TableStyle, error)

GetTextStyleFromString get the text style for a string.

Jump to

Keyboard shortcuts

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