display

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptySlices = errors.New("empty slices")

ErrEmptySlices signals that empty slices has been provided

View Source
var ErrNilDataLines = errors.New("nil lineData slice")

ErrNilDataLines signals that a nil data lines slice has been provided

View Source
var ErrNilDisplayByteSliceHandler = errors.New("nil display byte slice handler")

ErrNilDisplayByteSliceHandler signals that a nil display byte slice handler has been provided

View Source
var ErrNilHeader = errors.New("nil header")

ErrNilHeader signals that a nil header slice has been provided

View Source
var ErrNilLineDataInSlice = errors.New("nil line data element found in slice")

ErrNilLineDataInSlice signals that a nil line data element was found in slice

View Source
var ErrNilValuesOfLineDataInSlice = errors.New("nil line data values slice found")

ErrNilValuesOfLineDataInSlice signals that a line data element has nil values

Functions

func CreateTableString

func CreateTableString(header []string, data []*LineData) (string, error)

CreateTableString creates an ASCII table having header as table header and a LineData slice as table rows It automatically resize itself based on the lengths of every cell

func Headline

func Headline(message string, timestamp string, delimiter string) string

Headline will build a headline message given a delimiter string

timestamp parameter will be printed before the repeating delimiter

Types

type LineData

type LineData struct {
	Values              []string
	HorizontalRuleAfter bool
}

LineData represents a displayable table line

func NewLineData

func NewLineData(horizontalRuleAfter bool, values []string) *LineData

NewLineData creates a new LineData object

Jump to

Keyboard shortcuts

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