Documentation ¶
Index ¶
- func CSV(args ...string) [][]string
- func CSVByColumn(args ...string) (cols map[string][]string)
- func CSVByRow(args ...string) (rows []map[string]string)
- func JSON(in string) map[string]interface{}
- func JSONArray(in string) []interface{}
- func TOML(in string) interface{}
- func ToCSV(args ...interface{}) string
- func ToJSON(in interface{}) string
- func ToJSONPretty(indent string, in interface{}) string
- func ToTOML(in interface{}) string
- func ToYAML(in interface{}) string
- func YAML(in string) map[string]interface{}
- func YAMLArray(in string) []interface{}
- type Data
- func (d *Data) Cleanup()
- func (d *Data) Datasource(alias string, args ...string) (interface{}, error)
- func (d *Data) DatasourceExists(alias string) bool
- func (d *Data) DatasourceReachable(alias string, args ...string) bool
- func (d *Data) DefineDatasource(alias, value string) (*Source, error)
- func (d *Data) Include(alias string, args ...string) (string, error)
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSV ¶
CSV - Unmarshal CSV parameters:
delim - (optional) the (single-character!) field delimiter, defaults to "," in - the CSV-format string to parse
returns:
an array of rows, which are arrays of cells (strings)
func CSVByColumn ¶
CSVByColumn - Unmarshal CSV in a Columnar form parameters:
delim - (optional) the (single-character!) field delimiter, defaults to "," hdr - (optional) comma-separated list of column names, set to "" to get auto-named columns (A-Z), omit to use the first line in - the CSV-format string to parse
returns:
a map of columns, indexed by the header name. values are arrays of strings
func CSVByRow ¶
CSVByRow - Unmarshal CSV in a row-oriented form parameters:
delim - (optional) the (single-character!) field delimiter, defaults to "," hdr - (optional) comma-separated list of column names, set to "" to get auto-named columns (A-Z), omit to use the first line in - the CSV-format string to parse
returns:
an array of rows, indexed by the header name
func ToJSONPretty ¶
ToJSONPretty - Stringify a struct as JSON (indented)
Types ¶
type Data ¶
Data -
func (*Data) Cleanup ¶
func (d *Data) Cleanup()
Cleanup - clean up datasources before shutting the process down - things like Logging out happen here
func (*Data) Datasource ¶
Datasource -
func (*Data) DatasourceExists ¶
DatasourceExists -
func (*Data) DatasourceReachable ¶ added in v2.5.0
DatasourceReachable - Determines if the named datasource is reachable with the given arguments. Reads from the datasource, and discards the returned data.
func (*Data) DefineDatasource ¶ added in v2.7.0
DefineDatasource -
Click to show internal directories.
Click to hide internal directories.