Documentation
¶
Index ¶
- Variables
- 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 RowMapReplaceRecursive(base TableData, replacement map[int]map[int]TableCellInterface) map[int]map[int]TableCellInterface
- func SetStyleDefinition(name string, style TableStyleInterface)
- type PaddingType
- 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) 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) 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
Constants ¶
This section is empty.
Variables ¶
View Source
var Styles map[string]TableStyleInterface
Functions ¶
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 RowMapReplaceRecursive ¶
func RowMapReplaceRecursive( base TableData, replacement map[int]map[int]TableCellInterface, ) map[int]map[int]TableCellInterface
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 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) SetColumnPadding ¶
func (t *Table) SetColumnPadding(column int, padding PaddingType) *Table
func (*Table) SetFooterTitle ¶
func (*Table) SetHeaderTitle ¶
func (*Table) SetHeaders ¶
func (*Table) SetHeadersFromString ¶
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
Click to show internal directories.
Click to hide internal directories.