Documentation ¶
Overview ¶
Package parsers has internal parsers for various formats.
Index ¶
- func CSV(args ...string) ([][]string, error)
- func CSVByColumn(args ...string) (cols map[string][]string, err error)
- func CSVByRow(args ...string) (rows []map[string]string, err error)
- func CUE(in string) (interface{}, error)
- func DotEnv(in string) (interface{}, error)
- func JSON(in string) (map[string]interface{}, error)
- func JSONArray(in string) ([]interface{}, error)
- func ParseData(mimeType, s string) (out any, err error)
- func TOML(in string) (interface{}, error)
- func ToCSV(args ...interface{}) (string, error)
- func ToCUE(in interface{}) (string, error)
- func ToJSON(in interface{}) (string, error)
- func ToJSONPretty(indent string, in interface{}) (string, error)
- func ToTOML(in interface{}) (string, error)
- func ToYAML(in interface{}) (string, error)
- func YAML(in string) (map[string]interface{}, error)
- func YAMLArray(in string) ([]interface{}, error)
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) list of column names separated by `delim`, 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) list of column names separated by `delim`, 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 ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.