table

package
v0.0.0-...-0efc7b6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Unlicense Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DisplayTag = "display"
	// InlineDisplayTag usage: Embedded Struct `display:"inline"`
	InlineDisplayTag = "inline"
	// HiddenDisplayTag usage: Embedded Struct `display:"hidden"`
	HiddenDisplayTag = "hidden"

	// HeaderTag usage: Field string `header:"Name"`
	HeaderTag = "header"
	// NumberHeaderTag usage: NumberButString string `header:"Age,number"`
	NumberHeaderTag = "number"
	// CountHeaderTag usage: List []any `header:"MyList,count"`
	CountHeaderTag = "count"
	// ForceTextHeaderTag usage: ID int `header:"ID,text"`
	ForceTextHeaderTag = "text"

	// TimestampHeaderTag usage: Timestamp int64 `json:"timestamp" yaml:"Timestamp" header:"At,timestamp(ms|utc|02 Jan 2006 15:04)"`
	TimestampHeaderTag = "timestamp"
	// TimestampFromMillisecondsHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms)"`
	TimestampFromMillisecondsHeaderTag = "ms"
	// TimestampAsUTCHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc)"`
	TimestampAsUTCHeaderTag = "utc"
	// TimestampAsLocalHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|local)"`
	TimestampAsLocalHeaderTag = "local"
	// TimestampFormatHumanHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|human)"`
	TimestampFormatHumanHeaderTag = "human"
	// TimestampFormatANSICHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|ANSIC)"`
	TimestampFormatANSICHeaderTag = "ANSIC"
	// TimestampFormatUnixDateCHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|UnixDate)"`
	TimestampFormatUnixDateCHeaderTag = "UnixDate"
	// TimestampFormatRubyDateHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|RubyDate)"`
	TimestampFormatRubyDateHeaderTag = "RubyDate"
	// TimestampFormatRFC822HeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|RFC822)"`
	TimestampFormatRFC822HeaderTag = "RFC822"
	// TimestampFormatRFC822ZHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|RFC822Z)"`
	TimestampFormatRFC822ZHeaderTag = "RFC822Z"
	// TimestampFormatRFC850HeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|RFC850)"`
	TimestampFormatRFC850HeaderTag = "RFC850"
	// TimestampFormatRFC1123HeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|RFC1123)"`
	TimestampFormatRFC1123HeaderTag = "RFC1123"
	// TimestampFormatRFC1123ZHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|RFC1123Z)"`
	TimestampFormatRFC1123ZHeaderTag = "RFC1123Z" // default one.
	// TimestampFormatRFC3339HeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|RFC3339)"`
	TimestampFormatRFC3339HeaderTag = "RFC3339"
	// TimestampFormatARFC3339NanoHeaderTag usage: Timestamp int64 `header:"Start,timestamp(ms|utc|RFC3339Nano)"`
	TimestampFormatARFC3339NanoHeaderTag = "RFC3339Nano"

	// DurationHeaderTag usage: Uptime int64 `header:"Uptime,unixduration"`
	DurationHeaderTag = "unixduration"
	// DateHeaderTag usage: Start string `header:"Start,date"`, the field's value should be formatted as time.RFC3339
	DateHeaderTag = "date"
)

Variables

View Source
var (
	DefaultConfig = ParserConfig{
		TagsFieldsOnly:   false,
		UnexportedFields: false,
		MaxDepth:         -1,
	}
	StructParser = &structParser{Config: &DefaultConfig}
	SliceParser  = &sliceParser{Config: &DefaultConfig}
	MapParser    = &mapParser{Config: &DefaultConfig}
	JSONParser   = new(jsonParser)
)

The built'n type parsers, all except `JSONParser` are directly linked to the `Print/PrintHeadList` functions.

View Source
var (
	StructHeaders = make(map[reflect.Type][]StructHeader) // type is the root struct.

)

StructHeaders are being cached from the root-level structure to print out. They can be customized for custom head titles.

Header can also contain the necessary information about its values, useful for its presentation such as alignment, alternative value if main is empty, if the row should print the number of elements inside a list or if the column should be formated as number.

Functions

func CanAcceptRow

func CanAcceptRow(in reflect.Value, filters []RowFilter) bool

CanAcceptRow accepts a value of row and a set of filter and returns true if it can be printed, otherwise false. If no filters passed then it returns true.

func MapCellSplice

func MapCellSplice(data map[int]TableCellInterface, offset int, replacer TableCellInterface) map[int]TableCellInterface

func MapRowSplice

func MapRowSplice(data map[int]TableRowInterface, offset int, replacer TableRowInterface) map[int]TableRowInterface

func RegisterParser

func RegisterParser(kind reflect.Kind, parser Parser)

RegisterParser sets a parser based on its kind of type. It overrides any existing element on that kind, each Parser reflects a single kind of type.

It can be used at the initialization of the program to register a custom Parser, see `StructParser` for example. It's not designed to be safe to use it inside many different routines at the same time.

func RemoveStructHeader

func RemoveStructHeader(original interface{}, fieldName string) interface{}

RemoveStructHeader will dynamically remove a specific header tag from a struct's field based on the "fieldName" which must be a valid exported field of the struct. It returns the new, converted, struct value.

If "original" is not a struct or the "fieldName" was unable to be found then the "item" is returned as it was before this call.

See `SetStructHeader` too.

func RowMapReplaceRecursive

func RowMapReplaceRecursive(
	base TableData,
	replacement map[int]map[int]TableCellInterface,
) map[int]map[int]TableCellInterface

func SetStructHeader

func SetStructHeader(original interface{}, fieldName string, newHeaderValue string) interface{}

SetStructHeader dynamically sets the "newHeaderValue" to a specific struct's field's header tag's value based on the "fieldName" which must be a valid exported field of the struct.

It returns the new, converted, struct value.

If "original" is not a struct or the "fieldName" was unable to be found then the "item" is returned as it was before this call.

If the "newValue" is empty then the whole header will be removed, see `RemoveStructHeader` too.

func SetStyleDefinition

func SetStyleDefinition(name string, style TableStyleInterface)

Types

type PaddingType

type PaddingType int
const (
	PadDefault  PaddingType = 0
	PadToRight  PaddingType = 1
	PadToLeft   PaddingType = 2
	PadToCenter PaddingType = 3
)

type Parser

type Parser interface {
	// Parse Why not `ParseRows` and `ParseHeaders`?
	// Because type map has not a specific order, order can change at different runtimes,
	// so we must keep record on the keys order the first time we fetche them (=> see `MapParser#ParseRows`, `MapParser#ParseHeaders`).
	Parse(v reflect.Value, filters []RowFilter) (headers []TableRowInterface, rows [][]string, numbers []int)

	// SetConfig sets the parser's configuration.
	SetConfig(config *ParserConfig)
}

Parser should be implemented by all available reflect-based parsers.

See `StructParser`(struct{} type), `SliceParser`(slice[] type), `MapParser`(map type) and `JSONParser`(any type). Manually registering of a parser is a valid option (although not a recommendation), see `RegisterParser` for more.

func WhichParser

func WhichParser(typ reflect.Type, config *ParserConfig) Parser

WhichParser returns the available `Parser` for the "typ" type; Slice, Map, Struct...

type ParserConfig

type ParserConfig struct {
	TagsFieldsOnly   bool // if true, only tagged fields will be parsed.
	UnexportedFields bool // if true, unexported fields will be parsed too.
	MaxDepth         int  // max depth of the struct, -1 means no limit.
}

type RowFilter

type RowFilter func(reflect.Value) bool

RowFilter is the row's filter, accepts the reflect.Value of the custom type, and returns true if the particular row can be included in the final result.

func MakeFilters

func MakeFilters(in reflect.Value, genericFilters ...interface{}) (f []RowFilter)

MakeFilters accept a value of row and generic filters and returns a set of typed `RowFilter`.

Usage: in := reflect.ValueOf(myNewStructValue) filters := MakeFilters(in, func(v MyStruct) bool { return _custom logic here_ }) if CanAcceptRow(in, filters) { _custom logic here_ }

type StructHeader

type StructHeader struct {
	Name        string
	DefaultName bool

	InlineStruct bool

	// Position is the horizontal position (start from zero) of the header.
	Position int
	Depth    int
	ColSpan  int

	ValueAsNumber    bool
	ValueAsCountable bool
	ValueAsText      bool
	ValueAsTimestamp bool
	TimestampValue   TimestampHeaderTagValue
	ValueAsDate      bool
	ValueAsDuration  bool

	AlternativeValue string
}

StructHeader contains the name of the header extracted from the struct's `HeaderTag` field tag.

type Table

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

func NewTable

func NewTable() *Table

func (*Table) AddHeader

func (t *Table) AddHeader(row TableRowInterface) *Table

func (*Table) AddHeaderFromString

func (t *Table) AddHeaderFromString(row []string) *Table

func (*Table) AddHeaders

func (t *Table) AddHeaders(rows []TableRowInterface) *Table

func (*Table) AddHeadersFromString

func (t *Table) AddHeadersFromString(rows [][]string) *Table

func (*Table) AddRow

func (t *Table) AddRow(row TableRowInterface) *Table

func (*Table) AddRowFromString

func (t *Table) AddRowFromString(row []string) *Table

func (*Table) AddRows

func (t *Table) AddRows(rows []TableRowInterface) *Table

func (*Table) AddRowsFromString

func (t *Table) AddRowsFromString(rows [][]string) *Table

func (*Table) AddTableSeparator

func (t *Table) AddTableSeparator() *Table

func (*Table) GetCellsAsList

func (t *Table) GetCellsAsList() []TableCellInterface

func (*Table) GetColumnPadding

func (t *Table) GetColumnPadding(column int) PaddingType

func (*Table) GetColumnsAsList

func (t *Table) GetColumnsAsList() []TableColumnInterface

func (*Table) GetFooterTitle

func (t *Table) GetFooterTitle() string

func (*Table) GetHeaderTitle

func (t *Table) GetHeaderTitle() string

func (*Table) GetHeaders

func (t *Table) GetHeaders() *TableData

func (*Table) GetLinesAsList

func (t *Table) GetLinesAsList() []TableRowInterface

func (*Table) GetRows

func (t *Table) GetRows() *TableData

func (*Table) Parse

func (t *Table) Parse(in interface{}, filters ...interface{}) *Table

func (*Table) ParseHeaders

func (t *Table) ParseHeaders(in interface{}, filters ...interface{}) *Table

func (*Table) ParseJSON

func (t *Table) ParseJSON(in []byte, filters ...interface{}) *Table

func (*Table) ParseRows

func (t *Table) ParseRows(in interface{}, filters ...interface{}) *Table

func (*Table) SetColumnPadding

func (t *Table) SetColumnPadding(column int, padding PaddingType) *Table

func (*Table) SetFooterTitle

func (t *Table) SetFooterTitle(title string) *Table

func (*Table) SetHeaderTitle

func (t *Table) SetHeaderTitle(title string) *Table

func (*Table) SetHeaders

func (t *Table) SetHeaders(data *TableData) *Table

func (*Table) SetHeadersFromString

func (t *Table) SetHeadersFromString(rows [][]string) *Table

func (*Table) SetParseConfig

func (t *Table) SetParseConfig(config ParserConfig) *Table

func (*Table) SetParseMaxDepth

func (t *Table) SetParseMaxDepth(depth int) *Table

func (*Table) SetParseTagsFieldsOnly

func (t *Table) SetParseTagsFieldsOnly(v bool) *Table

func (*Table) SetParseUnexportedFields

func (t *Table) SetParseUnexportedFields(v bool) *Table

func (*Table) SetRows

func (t *Table) SetRows(data *TableData) *Table

func (*Table) SetRowsFromString

func (t *Table) SetRowsFromString(rows [][]string) *Table

type TableCell

type TableCell struct {
	Value   string
	Colspan int
	PadType PaddingType
	// contains filtered or unexported fields
}

func NewTableCell

func NewTableCell(value string) *TableCell

func (*TableCell) GetColspan

func (t *TableCell) GetColspan() int

func (*TableCell) GetPadType

func (t *TableCell) GetPadType() PaddingType

func (*TableCell) GetValue

func (t *TableCell) GetValue() string

func (*TableCell) SetColspan

func (t *TableCell) SetColspan(colspan int) *TableCell

func (*TableCell) SetPadType

func (t *TableCell) SetPadType(pad PaddingType) *TableCell

func (*TableCell) SetValue

func (t *TableCell) SetValue(value string) *TableCell

type TableCellInterface

type TableCellInterface interface {
	GetValue() string
	SetValue(value string) *TableCell

	GetColspan() int
	GetPadType() PaddingType
	// contains filtered or unexported methods
}

type TableColumn

type TableColumn struct {
	Cell TableCellInterface
}

func MakeColumnFromString

func MakeColumnFromString(cell string) *TableColumn

func NewTableColumn

func NewTableColumn() *TableColumn

func (*TableColumn) GetCell

func (t *TableColumn) GetCell() TableCellInterface

func (*TableColumn) SetCell

func (t *TableColumn) SetCell(cell TableCellInterface) *TableColumn

type TableColumnInterface

type TableColumnInterface interface {
	SetCell(cell TableCellInterface) *TableColumn
	GetCell() TableCellInterface
}

type TableData

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

func MakeDataFromStrings

func MakeDataFromStrings(rows [][]string) *TableData

func MergeData

func MergeData(datas ...*TableData) *TableData

func NewTableData

func NewTableData() *TableData

func RowMapFill

func RowMapFill(startIndex int, count int, value TableRowInterface) TableData

func (*TableData) AddRow

func (t *TableData) AddRow(row TableRowInterface) *TableData

func (*TableData) AddRowFromString

func (t *TableData) AddRowFromString(rowData []string) *TableData

func (*TableData) AddRows

func (t *TableData) AddRows(rows []TableRowInterface) *TableData

func (*TableData) AddRowsFromString

func (t *TableData) AddRowsFromString(rows [][]string) *TableData

func (*TableData) GetCellsAsList

func (t *TableData) GetCellsAsList() []TableCellInterface

func (*TableData) GetColumnsAsList

func (t *TableData) GetColumnsAsList() []TableColumnInterface

func (*TableData) GetRow

func (t *TableData) GetRow(index int) TableRowInterface

func (*TableData) GetRows

func (t *TableData) GetRows() map[int]TableRowInterface

func (*TableData) GetRowsAsList

func (t *TableData) GetRowsAsList() []TableRowInterface

func (*TableData) GetRowsSortedKeys

func (t *TableData) GetRowsSortedKeys() []int

func (*TableData) SetRow

func (t *TableData) SetRow(index int, row TableRowInterface) *TableData

func (*TableData) SetRows

func (t *TableData) SetRows(lines map[int]TableRowInterface) *TableData

type TableInterface

type TableInterface interface {
	SetHeaders(data *TableData) *Table
	GetHeaders() *TableData

	SetRows(data *TableData) *Table
	GetRows() *TableData

	SetHeaderTitle(title string) *Table
	GetHeaderTitle() string

	SetFooterTitle(title string) *Table
	GetFooterTitle() string

	GetLinesAsList() []TableRowInterface
	GetColumnsAsList() []TableColumnInterface
	GetCellsAsList() []TableCellInterface
}

type TableRender

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

func NewRender

func NewRender(output output.OutputInterface) *TableRender

Table constructor

func (*TableRender) GetColumnMaxWidth

func (t *TableRender) GetColumnMaxWidth(column int) int

func (*TableRender) GetColumnMinWidth

func (t *TableRender) GetColumnMinWidth(column int) int

func (*TableRender) GetColumnStyle

func (t *TableRender) GetColumnStyle(column int) TableStyleInterface

func (*TableRender) GetContent

func (t *TableRender) GetContent() *Table

func (*TableRender) Render

func (t *TableRender) Render()

func (*TableRender) SetColumnMaxWidth

func (t *TableRender) SetColumnMaxWidth(column int, width int) *TableRender

func (*TableRender) SetColumnMinWidth

func (t *TableRender) SetColumnMinWidth(column int, width int) *TableRender

func (*TableRender) SetColumnStyle

func (t *TableRender) SetColumnStyle(column int, name string) *TableRender

func (*TableRender) SetColumnWidth

func (t *TableRender) SetColumnWidth(column int, width int) *TableRender

func (*TableRender) SetColumnsMaxWidths

func (t *TableRender) SetColumnsMaxWidths(widths map[int]int) *TableRender

func (*TableRender) SetColumnsMinWidths

func (t *TableRender) SetColumnsMinWidths(widths map[int]int) *TableRender

func (*TableRender) SetColumnsWidths

func (t *TableRender) SetColumnsWidths(widths map[int]int) *TableRender

func (*TableRender) SetContent

func (t *TableRender) SetContent(content *Table) *TableRender

func (*TableRender) SetStyle

func (t *TableRender) SetStyle(style TableStyleInterface) *TableRender

func (*TableRender) SetStyleFromName

func (t *TableRender) SetStyleFromName(name string) *TableRender

type TableRow

type TableRow struct {
	Columns map[int]TableColumnInterface
}

func MakeRowFromStrings

func MakeRowFromStrings(column []string) *TableRow

func NewTableRow

func NewTableRow() *TableRow

func (*TableRow) AddColumn

func (t *TableRow) AddColumn(column TableColumnInterface) *TableRow

func (*TableRow) GetCellsAsList

func (t *TableRow) GetCellsAsList() []TableCellInterface

func (*TableRow) GetColumn

func (t *TableRow) GetColumn(column int) TableColumnInterface

func (*TableRow) GetColumns

func (t *TableRow) GetColumns() map[int]TableColumnInterface

func (*TableRow) GetColumnsSortedKeys

func (t *TableRow) GetColumnsSortedKeys() []int

func (*TableRow) SetColumn

func (t *TableRow) SetColumn(index int, column TableColumnInterface) *TableRow

func (*TableRow) SetColumns

func (t *TableRow) SetColumns(columns map[int]TableColumnInterface) *TableRow

type TableRowInterface

type TableRowInterface interface {
	SetColumns(columns map[int]TableColumnInterface) *TableRow
	GetColumns() map[int]TableColumnInterface

	GetColumnsSortedKeys() []int

	SetColumn(index int, cell TableColumnInterface) *TableRow
	GetColumn(column int) TableColumnInterface

	GetCellsAsList() []TableCellInterface
}

type TableSeparator

type TableSeparator struct {
	TableCell
	// contains filtered or unexported fields
}

func NewTableSeparator

func NewTableSeparator() *TableSeparator

TableSeparator constructors

func NewTableSeparatorDouble

func NewTableSeparatorDouble() *TableSeparator

func (*TableSeparator) IsDouble

func (t *TableSeparator) IsDouble() bool

func (*TableSeparator) IsSeparator

func (t *TableSeparator) IsSeparator() bool

type TableSeparatorInterface

type TableSeparatorInterface interface {
	IsSeparator() bool
	IsDouble() bool
}

type TableStyle

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

func NewTableStyle

func NewTableStyle() *TableStyle

func (*TableStyle) GetBorderFormat

func (t *TableStyle) GetBorderFormat() string

func (*TableStyle) GetCellHeaderFormat

func (t *TableStyle) GetCellHeaderFormat() string

func (*TableStyle) GetCellRowContentFormat

func (t *TableStyle) GetCellRowContentFormat() string

func (*TableStyle) GetCellRowFormat

func (t *TableStyle) GetCellRowFormat() string

func (*TableStyle) GetCrossingBottomLeftChar

func (t *TableStyle) GetCrossingBottomLeftChar() string

func (*TableStyle) GetCrossingBottomMidChar

func (t *TableStyle) GetCrossingBottomMidChar() string

func (*TableStyle) GetCrossingBottomRightChar

func (t *TableStyle) GetCrossingBottomRightChar() string

func (*TableStyle) GetCrossingChar

func (t *TableStyle) GetCrossingChar() string

func (*TableStyle) GetCrossingMidLeftChar

func (t *TableStyle) GetCrossingMidLeftChar() string

func (*TableStyle) GetCrossingMidRightChar

func (t *TableStyle) GetCrossingMidRightChar() string

func (*TableStyle) GetCrossingTopLeftBottomChar

func (t *TableStyle) GetCrossingTopLeftBottomChar() string

func (*TableStyle) GetCrossingTopLeftChar

func (t *TableStyle) GetCrossingTopLeftChar() string

func (*TableStyle) GetCrossingTopMidBottomChar

func (t *TableStyle) GetCrossingTopMidBottomChar() string

func (*TableStyle) GetCrossingTopMidChar

func (t *TableStyle) GetCrossingTopMidChar() string

func (*TableStyle) GetCrossingTopRightBottomChar

func (t *TableStyle) GetCrossingTopRightBottomChar() string

func (*TableStyle) GetCrossingTopRightChar

func (t *TableStyle) GetCrossingTopRightChar() string

func (TableStyle) GetFooterTitleFormat

func (t TableStyle) GetFooterTitleFormat() string

func (TableStyle) GetHeaderTitleFormat

func (t TableStyle) GetHeaderTitleFormat() string

func (*TableStyle) GetHorizontalInsideBorderChar

func (t *TableStyle) GetHorizontalInsideBorderChar() string

func (*TableStyle) GetHorizontalOutsideBorderChar

func (t *TableStyle) GetHorizontalOutsideBorderChar() string

func (*TableStyle) GetPadType

func (t *TableStyle) GetPadType() PaddingType

func (*TableStyle) GetPaddingChar

func (t *TableStyle) GetPaddingChar() string

func (*TableStyle) GetVerticalInsideBorderChar

func (t *TableStyle) GetVerticalInsideBorderChar() string

func (*TableStyle) GetVerticalOutsideBorderChar

func (t *TableStyle) GetVerticalOutsideBorderChar() string

func (TableStyle) Pad

func (t TableStyle) Pad(content string, length int, pad string, direction PaddingType) string

custom methods

func (*TableStyle) SetBorderFormat

func (t *TableStyle) SetBorderFormat(borderFormat string) *TableStyle

func (*TableStyle) SetCellHeaderFormat

func (t *TableStyle) SetCellHeaderFormat(cellHeaderFormat string) *TableStyle

func (*TableStyle) SetCellRowContentFormat

func (t *TableStyle) SetCellRowContentFormat(cellRowContentFormat string) *TableStyle

func (*TableStyle) SetCellRowFormat

func (t *TableStyle) SetCellRowFormat(cellRowFormat string) *TableStyle

func (*TableStyle) SetCrossingChar

func (t *TableStyle) SetCrossingChar(crossingChar string) *TableStyle

func (*TableStyle) SetCrossingChars

func (t *TableStyle) SetCrossingChars(
	cross string,
	topLeft string,
	topMid string,
	topRight string,
	midRight string,
	bottomRight string,
	bottomMid string,
	bottomLeft string,
	midLeft string,
	topLeftBottom string,
	topMidBottom string,
	topRightBottom string,

) *TableStyle

func (*TableStyle) SetHorizontalBorderChars

func (t *TableStyle) SetHorizontalBorderChars(borderChar string) *TableStyle

func (*TableStyle) SetHorizontalInsideBorderChar

func (t *TableStyle) SetHorizontalInsideBorderChar(borderChar string) *TableStyle

func (*TableStyle) SetHorizontalOutsideBorderChar

func (t *TableStyle) SetHorizontalOutsideBorderChar(borderChar string) *TableStyle

func (*TableStyle) SetPadType

func (t *TableStyle) SetPadType(padType PaddingType) *TableStyle

func (*TableStyle) SetPaddingChar

func (t *TableStyle) SetPaddingChar(paddingChar string) *TableStyle

func (*TableStyle) SetVerticalBorderChars

func (t *TableStyle) SetVerticalBorderChars(borderChar string) *TableStyle

func (*TableStyle) SetVerticalInsideBorderChar

func (t *TableStyle) SetVerticalInsideBorderChar(borderChar string) *TableStyle

func (*TableStyle) SetVerticalOutsideBorderChar

func (t *TableStyle) SetVerticalOutsideBorderChar(borderChar string) *TableStyle

type TableStyleInterface

type TableStyleInterface interface {
	GetPaddingChar() string

	GetHorizontalOutsideBorderChar() string
	GetHorizontalInsideBorderChar() string

	GetVerticalOutsideBorderChar() string
	GetVerticalInsideBorderChar() string

	GetCrossingChar() string

	GetCrossingTopRightChar() string
	GetCrossingTopMidChar() string
	GetCrossingTopLeftChar() string

	GetCrossingBottomRightChar() string
	GetCrossingBottomMidChar() string
	GetCrossingBottomLeftChar() string

	GetCrossingMidRightChar() string
	GetCrossingMidLeftChar() string

	GetCrossingTopLeftBottomChar() string
	GetCrossingTopMidBottomChar() string
	GetCrossingTopRightBottomChar() string

	GetHeaderTitleFormat() string
	GetFooterTitleFormat() string

	GetCellHeaderFormat() string
	GetCellRowFormat() string
	GetCellRowContentFormat() string
	GetBorderFormat() string
	GetPadType() PaddingType
	Pad(content string, length int, pad string, direction PaddingType) string
}

func GetStyleDefinition

func GetStyleDefinition(name string) TableStyleInterface

type TimestampHeaderTagValue

type TimestampHeaderTagValue struct {
	FromMilliseconds bool

	UTC   bool
	Local bool

	Human bool

	Format string
}

TimestampHeaderTagValue the header's value of a "timestamp" header tag functionality.

Jump to

Keyboard shortcuts

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