Documentation ¶
Index ¶
- Constants
- Variables
- func CanAcceptRow(in reflect.Value, filters []RowFilter) bool
- func MapCellSplice(data map[int]TableCellInterface, offset int, replacer TableCellInterface) map[int]TableCellInterface
- func MapRowSplice(data map[int]TableRowInterface, offset int, replacer TableRowInterface) map[int]TableRowInterface
- func RegisterParser(kind reflect.Kind, parser Parser)
- func RemoveStructHeader(original interface{}, fieldName string) interface{}
- func RowMapReplaceRecursive(base TableData, replacement map[int]map[int]TableCellInterface) map[int]map[int]TableCellInterface
- func SetStructHeader(original interface{}, fieldName string, newHeaderValue string) interface{}
- func SetStyleDefinition(name string, style TableStyleInterface)
- type PaddingType
- type Parser
- type ParserConfig
- type RowFilter
- type StructHeader
- type Table
- func (t *Table) AddHeader(row TableRowInterface) *Table
- func (t *Table) AddHeaderFromString(row []string) *Table
- func (t *Table) AddHeaders(rows []TableRowInterface) *Table
- func (t *Table) AddHeadersFromString(rows [][]string) *Table
- func (t *Table) AddRow(row TableRowInterface) *Table
- func (t *Table) AddRowFromString(row []string) *Table
- func (t *Table) AddRows(rows []TableRowInterface) *Table
- func (t *Table) AddRowsFromString(rows [][]string) *Table
- func (t *Table) AddTableSeparator() *Table
- func (t *Table) GetCellsAsList() []TableCellInterface
- func (t *Table) GetColumnPadding(column int) PaddingType
- func (t *Table) GetColumnsAsList() []TableColumnInterface
- func (t *Table) GetFooterTitle() string
- func (t *Table) GetHeaderTitle() string
- func (t *Table) GetHeaders() *TableData
- func (t *Table) GetLinesAsList() []TableRowInterface
- func (t *Table) GetRows() *TableData
- func (t *Table) Parse(in interface{}, filters ...interface{}) *Table
- func (t *Table) ParseHeaders(in interface{}, filters ...interface{}) *Table
- func (t *Table) ParseJSON(in []byte, filters ...interface{}) *Table
- func (t *Table) ParseRows(in interface{}, filters ...interface{}) *Table
- func (t *Table) SetColumnPadding(column int, padding PaddingType) *Table
- func (t *Table) SetFooterTitle(title string) *Table
- func (t *Table) SetHeaderTitle(title string) *Table
- func (t *Table) SetHeaders(data *TableData) *Table
- func (t *Table) SetHeadersFromString(rows [][]string) *Table
- func (t *Table) SetParseConfig(config ParserConfig) *Table
- func (t *Table) SetParseMaxDepth(depth int) *Table
- func (t *Table) SetParseTagsFieldsOnly(v bool) *Table
- func (t *Table) SetParseUnexportedFields(v bool) *Table
- func (t *Table) SetRows(data *TableData) *Table
- func (t *Table) SetRowsFromString(rows [][]string) *Table
- type TableCell
- type TableCellInterface
- type TableColumn
- type TableColumnInterface
- type TableData
- func (t *TableData) AddRow(row TableRowInterface) *TableData
- func (t *TableData) AddRowFromString(rowData []string) *TableData
- func (t *TableData) AddRows(rows []TableRowInterface) *TableData
- func (t *TableData) AddRowsFromString(rows [][]string) *TableData
- func (t *TableData) GetCellsAsList() []TableCellInterface
- func (t *TableData) GetColumnsAsList() []TableColumnInterface
- func (t *TableData) GetRow(index int) TableRowInterface
- func (t *TableData) GetRows() map[int]TableRowInterface
- func (t *TableData) GetRowsAsList() []TableRowInterface
- func (t *TableData) GetRowsSortedKeys() []int
- func (t *TableData) SetRow(index int, row TableRowInterface) *TableData
- func (t *TableData) SetRows(lines map[int]TableRowInterface) *TableData
- type TableInterface
- type TableRender
- func (t *TableRender) GetColumnMaxWidth(column int) int
- func (t *TableRender) GetColumnMinWidth(column int) int
- func (t *TableRender) GetColumnStyle(column int) TableStyleInterface
- func (t *TableRender) GetContent() *Table
- func (t *TableRender) Render()
- func (t *TableRender) SetColumnMaxWidth(column int, width int) *TableRender
- func (t *TableRender) SetColumnMinWidth(column int, width int) *TableRender
- func (t *TableRender) SetColumnStyle(column int, name string) *TableRender
- func (t *TableRender) SetColumnWidth(column int, width int) *TableRender
- func (t *TableRender) SetColumnsMaxWidths(widths map[int]int) *TableRender
- func (t *TableRender) SetColumnsMinWidths(widths map[int]int) *TableRender
- func (t *TableRender) SetColumnsWidths(widths map[int]int) *TableRender
- func (t *TableRender) SetContent(content *Table) *TableRender
- func (t *TableRender) SetStyle(style TableStyleInterface) *TableRender
- func (t *TableRender) SetStyleFromName(name string) *TableRender
- type TableRow
- func (t *TableRow) AddColumn(column TableColumnInterface) *TableRow
- func (t *TableRow) GetCellsAsList() []TableCellInterface
- func (t *TableRow) GetColumn(column int) TableColumnInterface
- func (t *TableRow) GetColumns() map[int]TableColumnInterface
- func (t *TableRow) GetColumnsSortedKeys() []int
- func (t *TableRow) SetColumn(index int, column TableColumnInterface) *TableRow
- func (t *TableRow) SetColumns(columns map[int]TableColumnInterface) *TableRow
- type TableRowInterface
- type TableSeparator
- type TableSeparatorInterface
- type TableStyle
- func (t *TableStyle) GetBorderFormat() string
- func (t *TableStyle) GetCellHeaderFormat() string
- func (t *TableStyle) GetCellRowContentFormat() string
- func (t *TableStyle) GetCellRowFormat() string
- func (t *TableStyle) GetCrossingBottomLeftChar() string
- func (t *TableStyle) GetCrossingBottomMidChar() string
- func (t *TableStyle) GetCrossingBottomRightChar() string
- func (t *TableStyle) GetCrossingChar() string
- func (t *TableStyle) GetCrossingMidLeftChar() string
- func (t *TableStyle) GetCrossingMidRightChar() string
- func (t *TableStyle) GetCrossingTopLeftBottomChar() string
- func (t *TableStyle) GetCrossingTopLeftChar() string
- func (t *TableStyle) GetCrossingTopMidBottomChar() string
- func (t *TableStyle) GetCrossingTopMidChar() string
- func (t *TableStyle) GetCrossingTopRightBottomChar() string
- func (t *TableStyle) GetCrossingTopRightChar() string
- func (t TableStyle) GetFooterTitleFormat() string
- func (t TableStyle) GetHeaderTitleFormat() string
- func (t *TableStyle) GetHorizontalInsideBorderChar() string
- func (t *TableStyle) GetHorizontalOutsideBorderChar() string
- func (t *TableStyle) GetPadType() PaddingType
- func (t *TableStyle) GetPaddingChar() string
- func (t *TableStyle) GetVerticalInsideBorderChar() string
- func (t *TableStyle) GetVerticalOutsideBorderChar() string
- func (t TableStyle) Pad(content string, length int, pad string, direction PaddingType) string
- func (t *TableStyle) SetBorderFormat(borderFormat string) *TableStyle
- func (t *TableStyle) SetCellHeaderFormat(cellHeaderFormat string) *TableStyle
- func (t *TableStyle) SetCellRowContentFormat(cellRowContentFormat string) *TableStyle
- func (t *TableStyle) SetCellRowFormat(cellRowFormat string) *TableStyle
- func (t *TableStyle) SetCrossingChar(crossingChar string) *TableStyle
- func (t *TableStyle) SetCrossingChars(cross string, topLeft string, topMid string, topRight string, midRight string, ...) *TableStyle
- func (t *TableStyle) SetHorizontalBorderChars(borderChar string) *TableStyle
- func (t *TableStyle) SetHorizontalInsideBorderChar(borderChar string) *TableStyle
- func (t *TableStyle) SetHorizontalOutsideBorderChar(borderChar string) *TableStyle
- func (t *TableStyle) SetPadType(padType PaddingType) *TableStyle
- func (t *TableStyle) SetPaddingChar(paddingChar string) *TableStyle
- func (t *TableStyle) SetVerticalBorderChars(borderChar string) *TableStyle
- func (t *TableStyle) SetVerticalInsideBorderChar(borderChar string) *TableStyle
- func (t *TableStyle) SetVerticalOutsideBorderChar(borderChar string) *TableStyle
- type TableStyleInterface
- type TimestampHeaderTagValue
Constants ¶
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 ¶
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.
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.
var Styles map[string]TableStyleInterface
Functions ¶
func CanAcceptRow ¶ added in v1.4.1
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 ¶ added in v1.4.1
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 ¶ added in v1.4.1
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 ¶ added in v1.4.1
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 ¶ added in v1.4.1
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 ¶ added in v1.4.1
func WhichParser(typ reflect.Type, config *ParserConfig) Parser
WhichParser returns the available `Parser` for the "typ" type; Slice, Map, Struct...
type ParserConfig ¶ added in v1.4.1
type RowFilter ¶ added in v1.4.1
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 ¶ added in v1.4.1
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 ¶ added in v1.4.1
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 (*Table) AddHeader ¶
func (t *Table) AddHeader(row TableRowInterface) *Table
func (*Table) AddHeaderFromString ¶
func (*Table) AddHeaders ¶
func (t *Table) AddHeaders(rows []TableRowInterface) *Table
func (*Table) AddHeadersFromString ¶
func (*Table) AddRow ¶
func (t *Table) AddRow(row TableRowInterface) *Table
func (*Table) AddRowFromString ¶
func (*Table) AddRows ¶
func (t *Table) AddRows(rows []TableRowInterface) *Table
func (*Table) AddRowsFromString ¶
func (*Table) AddTableSeparator ¶
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 (*Table) GetHeaderTitle ¶
func (*Table) GetHeaders ¶
func (*Table) GetLinesAsList ¶
func (t *Table) GetLinesAsList() []TableRowInterface
func (*Table) ParseHeaders ¶ added in v1.4.1
func (*Table) SetColumnPadding ¶
func (t *Table) SetColumnPadding(column int, padding PaddingType) *Table
func (*Table) SetFooterTitle ¶
func (*Table) SetHeaderTitle ¶
func (*Table) SetHeaders ¶
func (*Table) SetHeadersFromString ¶
func (*Table) SetParseConfig ¶ added in v1.4.1
func (t *Table) SetParseConfig(config ParserConfig) *Table
func (*Table) SetParseMaxDepth ¶ added in v1.4.1
func (*Table) SetParseTagsFieldsOnly ¶ added in v1.4.1
func (*Table) SetParseUnexportedFields ¶ added in v1.4.1
func (*Table) SetRowsFromString ¶
type TableCell ¶
type TableCell struct { Value string Colspan int PadType PaddingType // contains filtered or unexported fields }
func NewTableCell ¶
func (*TableCell) GetColspan ¶
func (*TableCell) GetPadType ¶
func (t *TableCell) GetPadType() PaddingType
func (*TableCell) SetColspan ¶
func (*TableCell) SetPadType ¶
func (t *TableCell) SetPadType(pad PaddingType) *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 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 (*TableData) AddRows ¶
func (t *TableData) AddRows(rows []TableRowInterface) *TableData
func (*TableData) AddRowsFromString ¶
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 ¶
type TableInterface ¶
type TableInterface interface { SetHeaders(data *TableData) *Table GetHeaders() *TableData SetRows(data *TableData) *Table GetRows() *TableData SetHeaderTitle(title string) *Table GetHeaderTitle() string GetLinesAsList() []TableRowInterface GetColumnsAsList() []TableColumnInterface GetCellsAsList() []TableCellInterface }
type TableRender ¶
type TableRender struct {
// contains filtered or unexported fields
}
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 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 (*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 NewTableSeparatorDouble ¶
func NewTableSeparatorDouble() *TableSeparator
func (*TableSeparator) IsDouble ¶
func (t *TableSeparator) IsDouble() bool
func (*TableSeparator) IsSeparator ¶
func (t *TableSeparator) IsSeparator() bool
type TableSeparatorInterface ¶
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 (*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 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