Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Align ¶
type Align struct {
// contains filtered or unexported fields
}
Align scans input and writes output with aligned text.
func NewAlign ¶
NewAlign creates and initializes a ScanWriter with in and out as its initial Reader and Writer and sets del to the desired delimiter to be used for alignment. It is meant to read the contents of its io.Reader to determine the length of each field and output the results in an aligned format. Left Justification is used by default. See UpdatePadding to set the Justification.
func (*Align) Align ¶
func (a *Align) Align()
Align determines the length of each field of text around the configured delimiter and aligns all of the text by the delimiter.
func (*Align) FilterColumns ¶
FilterColumns sets which column numbers should be output.
func (*Align) OutputSep ¶
OutputSep sets the output separator string with outsep if a different value from the input sep is desired.
func (*Align) UpdatePadder ¶ added in v1.1.0
UpdatePadder sets the Align's padder implementation if a different one is desired from the default.
func (*Align) UpdatePadding ¶
func (a *Align) UpdatePadding(p PaddingOpts)
UpdatePadding uses PaddingOpts p to update the Align's padding options.
type Grower ¶ added in v1.1.0
type Grower interface { Grow(n int) Reset() }
Grower grows by the given number of bytes n. Reset will set the Grower to 0.
type Justification ¶
type Justification byte
Justification is used to set the alignment of the column contents itself along the right, left, or center.
const ( JustifyRight Justification = iota + 1 JustifyCenter JustifyLeft )
Left, Right or Center Justification options.
type PadGrower ¶ added in v1.1.0
PadGrower makes a string with the ability to grow the underlying buffer.
type Padder ¶ added in v1.1.0
type Padder interface { io.Writer fmt.Stringer WriteByte(c byte) error WriteString(s string) (int, error) Bytes() []byte }
Padder builds a string and can return its string value.
type PaddingOpts ¶
type PaddingOpts struct { Justification Justification ColumnOverride map[int]Justification //override the Justification of specified columns Pad int // padding surrounding the separator }
PaddingOpts provides configurability for left/center/right Justification and padding length.
type TextQualifier ¶
TextQualifier is used to configure the scanner to account for a text qualifier.