text

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment added in v0.0.4

type Alignment int

Text Alignment

const (
	Left Alignment
	Right
)

type Format added in v0.0.4

type Format struct {
	// The maximum width of the field
	Width int

	// The alignment of the field (Left or Right)
	Align Alignment

	// Whether to wrap text
	Wrap bool
}

Format defines the format of a field

type Opt

type Opt func(*opts) error

Opt is a function which can be used to set options on the text output

func OptDelim added in v0.0.4

func OptDelim(delim rune) Opt

Set the field delimiter, default is '|'

func OptFormat added in v0.0.4

func OptFormat(format Format, fields ...int) Opt

Set the text format for fields. If fields is omitted, then the format is set for all fields

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(w io.Writer, opts ...Opt) (*Writer, error)

func (*Writer) Write

func (w *Writer) Write(v []string) error

Jump to

Keyboard shortcuts

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