Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TitleStyle can be used to format a string; suitable for titles TitleStyle = globals.TitleStyle // PrimaryTextStyle can be used to format a string; suitable for emphasis PrimaryTextStyle = globals.PrimaryTextStyle // CTATextStyle can be used to format a string; important text CTATextStyle = globals.CTATextStyle )
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct { Title string CellTransformer func(data interface{}) string ColumnStyle func(string) string }
Column describes a standard table's column
type Row ¶
type Row struct {
Value interface{}
}
Row describes a value that will represent a row in our table
type Table ¶
type Table struct { Columns []*Column // contains filtered or unexported fields }
Table describes a set of related data
func New ¶
New return a new Table given columns
Usage:
table := table.New([]*table.Column{ { Title: "Source", ColumnStyle: table.PrimaryTextStyle, // Make each row blue CellTransformer: func(data interface{}) string { event, _ := data.(types.Event) return event.Entity.Name // Called for each row } }, // ... }) table.Render(data)
Click to show internal directories.
Click to hide internal directories.