Documentation ¶
Index ¶
- Variables
- func ParseCsv(r io.Reader, typeConverts map[string]func(interface{}) (interface{}, error)) ([]map[string]interface{}, error)
- func ParseInterface(v interface{}) (map[string]interface{}, error)
- func ParseJSON(b []byte) (map[string]interface{}, error)
- func ParseJSONAsFile(newPath string, value interface{}) (string, error)
- func ParseJSONAsObject(b []byte, value interface{}) error
- func ParseJSONFile(b []byte) ([]map[string]interface{}, error)
- func ParseJSONFileWithFunc(b []byte, parseFunc func(b []byte) (map[string]interface{}, error)) ([]map[string]interface{}, error)
- func RemoveFirstEmptyBytes(b []byte) []byte
- type ParseError
- func ParseJSONBytesWithFuncFallback(b []byte, parseFunc func(b []byte) (map[string]interface{}, error)) ([]map[string]interface{}, []ParseError, error)
- func ParseJSONFileWithFuncFallback(r io.Reader, parseFunc func(b []byte) (map[string]interface{}, error)) ([]map[string]interface{}, []ParseError, error)
Constants ¶
This section is empty.
Variables ¶
var ErrValueIsNil = errors.New("value is nil")
Functions ¶
func ParseCsv ¶
func ParseCsv(r io.Reader, typeConverts map[string]func(interface{}) (interface{}, error)) ([]map[string]interface{}, error)
ParseCsv return objects with formatted keys: toLower and replaced all spaces with underscore cast types
func ParseInterface ¶
ParseInterface converts interface into json bytes then into map with json Numbers
func ParseJSON ¶
ParseJSON converts json bytes into map with json Numbers removes first empty bytes if exist
func ParseJSONAsFile ¶
ParseJSONAsFile parses value and write it to a json file returns path to created json file or return value if it is already path to json file or empty string if value is nil
func ParseJSONAsObject ¶
ParseJSONAsObject converts json bytes into the object removes first empty bytes if exist
func ParseJSONFile ¶
ParseJSONFile converts bytes (JSON objects with \n delimiter) into slice of map with json Numbers
func ParseJSONFileWithFunc ¶
func ParseJSONFileWithFunc(b []byte, parseFunc func(b []byte) (map[string]interface{}, error)) ([]map[string]interface{}, error)
ParseJSONFileWithFunc converts bytes (JSON objects with \n delimiter) into slice of map with json Numbers failfast: returns err if at least 1 occurred
func RemoveFirstEmptyBytes ¶
RemoveFirstEmptyBytes checks if array contains empty bytes in the begging and removes them
Types ¶
type ParseError ¶
func ParseJSONBytesWithFuncFallback ¶
func ParseJSONBytesWithFuncFallback(b []byte, parseFunc func(b []byte) (map[string]interface{}, error)) ([]map[string]interface{}, []ParseError, error)
ParseJSONBytesWithFuncFallback converts bytes (JSON objects with \n delimiter) into slice of map with json Numbers returns slice with events and slice with parsing errors which contains malformed JSON's(malformed lines)
func ParseJSONFileWithFuncFallback ¶
func ParseJSONFileWithFuncFallback(r io.Reader, parseFunc func(b []byte) (map[string]interface{}, error)) ([]map[string]interface{}, []ParseError, error)
ParseJSONFileWithFuncFallback converts bytes (JSON objects with \n delimiter) into slice of map with json Numbers returns slice with events and slice with parsing errors which contains malformed JSON's(malformed lines)