Documentation ¶
Index ¶
- func RowToMap(om Row) map[string]interface{}
- type FieldName
- type GenericCellValue
- type MapRowPair
- type Row
- func NewRow(initialData ...MapRowPair) Row
- func NewRowFromMap(hash map[FieldName]GenericCellValue) Row
- func NewRowFromMapWithColumns(hash map[FieldName]GenericCellValue, columns []FieldName) Row
- func NewRowFromRow(row Row) Row
- func NewRowFromStruct(i interface{}, lowerCaseKeys bool) Row
- func SetFromStruct(row Row, i interface{}, lowerCaseKeys bool) Row
- type Table
- type TableName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GenericCellValue ¶
type GenericCellValue = interface{}
type MapRowPair ¶ added in v0.3.0
type MapRowPair = orderedmap.Pair[FieldName, GenericCellValue]
func MRP ¶ added in v0.3.0
func MRP(key FieldName, value GenericCellValue) MapRowPair
MRP creates a new MapRowPair with the given key and value. This is useful when creating a Row with NewRow.
type Row ¶
type Row = *orderedmap.OrderedMap[FieldName, GenericCellValue]
func NewRow ¶ added in v0.3.0
func NewRow(initialData ...MapRowPair) Row
NewRow creates a new Row instance with the given initial data pairs. The order of the pairs is preserved.
func NewRowFromMap ¶ added in v0.3.0
func NewRowFromMap(hash map[FieldName]GenericCellValue) Row
NewRowFromMap creates a new Row instance populated with the contents of the provided map. The fields in the resulting Row are sorted alphabetically.
func NewRowFromMapWithColumns ¶ added in v0.3.0
func NewRowFromMapWithColumns(hash map[FieldName]GenericCellValue, columns []FieldName) Row
NewRowFromMapWithColumns creates a new Row instance with values from the provided map, but only for the columns specified. If a column doesn't exist in the map, it is skipped.
func NewRowFromRow ¶ added in v0.4.13
NewRowFromRow creates a new Row instance with a deep copy of the contents from the provided row.
func NewRowFromStruct ¶ added in v0.3.0
NewRowFromStruct creates a new Row instance populated with the field values from the provided struct. The field names of the struct become the keys in the Row. If lowerCaseKeys is true, the field names are converted to lowercase.
func SetFromStruct ¶ added in v0.4.0
SetFromStruct populates the provided row with values from the given struct. The field names of the struct become the keys in the Row. If lowerCaseKeys is true, the field names are converted to lowercase. Returns the populated row.
type Table ¶
func (*Table) SetColumnOrder ¶ added in v0.3.0
SetColumnOrder will set the given columns to be the first one to be output. Other columns already present in the order will be appended at the end, preserving the original order.