Versions in this module Expand all Collapse all v0 v0.3.4 Apr 4, 2025 v0.3.3 Mar 14, 2025 v0.3.2 Mar 13, 2025 Changes in this version + func LastNumericIndex(field string) int + func VersionIndex(field string) int type ColumnFlags + const AlignVersionFlag + func (f ColumnFlags) IsVersionAligned() bool v0.3.1 Mar 12, 2025 Changes in this version + const JSON_NULL + var ErrBadAlignmentTemplate = errors.New("bad alignment template") + var ErrBadColumnTemplate = errors.New("bad column template") + var ErrBadHorizontal = errors.New("bad horizontal ruler character") + var ErrBadSortTemplate = errors.New("bad sort template") + var ErrBadVertical = errors.New("bad vertical ruler character") + var ErrLongTemplate = errors.New("ruler template is too long") + var ErrMissingHorizontal = errors.New("missing required horizontal character (`-` or `=`)") + func LookupFunc[T any](m *FieldMap) func(fields []T, name string) (value T) + func NumericIndex(field string) int + type Column struct + Flags ColumnFlags + FullWidth int + LeftWidth int + Name string + RightWidth int + func (c *Column) Clone() *Column + func (c *Column) CmpSign() + func (c *Column) DisableSort() + func (c *Column) EnableSort() + func (c *Column) IsAscendingOrder() bool + func (c *Column) IsCenterAligned() bool + func (c *Column) IsConfigured() bool + func (c *Column) IsDefaultAligned() bool + func (c *Column) IsDescendingOrder() bool + func (c *Column) IsLeftAligned() bool + func (c *Column) IsNumberAligned() bool + func (c *Column) IsRightAligned() bool + func (c *Column) IsSorted() bool + func (c *Column) ReverseSort() + func (c *Column) SetAlignment(flags ColumnFlags) + func (c *Column) SetMinWidth(widths ...int) + func (c *Column) SetSortPriority(prio int) + func (c *Column) SortPriority() int + func (c *Column) UnmarshalJSON(data []byte) error + func (c Column) MarshalJSON() ([]byte, error) + type ColumnFlags byte + const AlignCenterFlag + const AlignLeftFlag + const AlignNumericFlag + const AlignRightFlag + const AlignmentMask + const SortAscendingFlag + const SortColumnFlag + const SortDescendingFlag + const SortDirectionMask + const SortFlagsMask + const SortPriorityMask + const UnalignedFlag + const UnconfiguredFlags + func (f *ColumnFlags) DisableSort() + func (f *ColumnFlags) EnableSort() + func (f *ColumnFlags) ReverseSort() + func (f *ColumnFlags) SetAlignment(flags ColumnFlags) + func (f *ColumnFlags) SetSort(s ColumnFlags) + func (f *ColumnFlags) SetSortPriority(prio int) + func (f *ColumnFlags) UnmarshalJSON(data []byte) error + func (f ColumnFlags) AlignmentString() string + func (f ColumnFlags) CloneWithAlignmentFlags(alignmentFlags ColumnFlags) ColumnFlags + func (f ColumnFlags) CloneWithSortingFlags(sortingFlags ColumnFlags) ColumnFlags + func (f ColumnFlags) CloneWithSortingPriority(sortingPriority int) ColumnFlags + func (f ColumnFlags) CmpSign() int + func (f ColumnFlags) IsAscendingOrder() bool + func (f ColumnFlags) IsCenterAligned() bool + func (f ColumnFlags) IsConfigured() bool + func (f ColumnFlags) IsDefaultAligned() bool + func (f ColumnFlags) IsDescendingOrder() bool + func (f ColumnFlags) IsLeftAligned() bool + func (f ColumnFlags) IsNumberAligned() bool + func (f ColumnFlags) IsRightAligned() bool + func (f ColumnFlags) IsSorted() bool + func (f ColumnFlags) MarshalJSON() ([]byte, error) + func (f ColumnFlags) SortPriority() int + func (f ColumnFlags) SortString() string + func (f ColumnFlags) String() string + type ColumnSet struct + Columns []*Column + func (cs *ColumnSet) AppendNewColumn() *Column + func (cs *ColumnSet) BySortPriority() *ColumnSet + func (cs *ColumnSet) Clone() *ColumnSet + func (cs *ColumnSet) ColumnAtPosition(pos int) *Column + func (cs *ColumnSet) ColumnNames() []string + func (cs *ColumnSet) Consolidate() + func (cs *ColumnSet) IsEmpty() bool + func (cs *ColumnSet) ReplaceColumnFlags(hints *ColumnSet) + func (cs *ColumnSet) TotalWidth() (w int) + func (cs *ColumnSet) UnmarshalJSON(data []byte) error + func (cs ColumnSet) MarshalJSON() ([]byte, error) + type ColumnWidth struct + Bytes int + Chars int + Left int + Right int + func (cw *ColumnWidth) ScanField(field string, cf ColumnFlags) + func (cw ColumnWidth) String() string + type Config struct + AlignDocument Nullable[bool] + ColumnFlags SliceMap[ColumnFlags] + ColumnFlagsMask ColumnFlags + LocaleTag Nullable[string] + Prefix Nullable[string] + Rulers []*Ruler + Sort Nullable[bool] + SortColumns []SortColumn + SquashEmptyColumns Nullable[bool] + TerminateEarly bool + func (cfg *Config) AppendSortColumn(arg string) + func (cfg *Config) String() string + type Document struct + func (doc *Document) AppendRow(prefix string, row []string) + func (doc *Document) AppendRuler(prefix, template string, colFlags []ColumnFlags) + func (doc *Document) AppendText(line string) + func (doc *Document) Items() []*DocumentItem + func (doc *Document) Tables() []*Table + type DocumentItem struct + type FieldMap struct + func NewFieldMap(names []string) *FieldMap + func (m *FieldMap) Find(name string) (pos int, ok bool) + type Nullable struct + func NewNullable[T comparable](value ...T) Nullable[T] + func (n *Nullable[T]) Clear() + func (n *Nullable[T]) Coalesce(in ...Nullable[T]) + func (n *Nullable[T]) CoalesceValue(values ...T) + func (n *Nullable[T]) Set(value T) + func (n *Nullable[T]) UnmarshalJSON(data []byte) error + func (n Nullable[T]) Get() (value T, IsSet bool) + func (n Nullable[T]) IsNull() bool + func (n Nullable[T]) IsSet() bool + func (n Nullable[T]) MarshalJSON() ([]byte, error) + func (n Nullable[T]) Value() (value T) + type Prefix struct + func (p *Prefix) IsSet() bool + func (p *Prefix) Reset(prefix string) + func (p *Prefix) SetOnce(prefix string) + func (p *Prefix) String() string + func (p *Prefix) UnmarshalJSON(data []byte) error + func (p Prefix) MarshalJSON() ([]byte, error) + type Ruler struct + Border byte + Horizontal byte + Padding byte + Pos int + Separator byte + func NewRuler(template string) (*Ruler, error) + func (r *Ruler) String() string + func (r *Ruler) Template() string + func (r *Ruler) UnmarshalJSON(data []byte) error + func (r *Ruler) Validate() error + func (r Ruler) MarshalJSON() ([]byte, error) + type SliceMap struct + Data []T + func (s *SliceMap[T]) Delete(i int) + func (s *SliceMap[T]) Grow(size int) + func (s *SliceMap[T]) Reset() + func (s *SliceMap[T]) Set(i int, v ...T) + func (s SliceMap[T]) Cap() int + func (s SliceMap[T]) Get(i int) (v T, isInRange bool) + func (s SliceMap[T]) Has(i int) bool + func (s SliceMap[T]) IsEmpty() bool + func (s SliceMap[T]) Value(i int) (v T) + type SortColumn struct + Descending bool + Name string + type Table struct + ColumnFlags []ColumnFlags + Prefix Nullable[string] + Rows [][]string + Rulers []*Ruler + func (tbl *Table) AllRows() [][]string + func (tbl *Table) AppendRow(row []string) + func (tbl *Table) AppendRuler(template string) error + func (tbl *Table) ColumnNames() []string + func (tbl *Table) DataRows() [][]string + func (tbl Table) String() string + type Text struct + Lines []string