datarow

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataRows

func DataRows(data []map[string]interface{}, columns map[string][]string, intervals map[string][]string, values map[string]string) (rows map[string]map[string]interface{})

DataRows converts the raw data into row structure (via DataToRows) then removes items with empty data, to reduce the size of data sets for display etc

func DataToRows

func DataToRows(data []map[string]interface{}, columns map[string][]string, intervals map[string][]string, values map[string]string) (rows map[string]map[string]interface{})

DataToRow converts the api data and using the columns and intervals generates a skeleton struct of all possible records and then fills in the interval values where data is found This resulting map can be iterated over as if each item is a row in the table

func K

func K(c string, v interface{}) string

K helper to generate a k with known dividers

func Key

func Key(item map[string]interface{}, cols []string) string

func Skeleton

func Skeleton(columnsAndPossible map[string][]string, intervals map[string][]string) (skel map[string]map[string]interface{})

Skeleton uses the set of columns and intervals to generate a row for each possible type

Types

This section is empty.

Jump to

Keyboard shortcuts

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