Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeJSONFile(filename string) (map[string]interface{}, error)
- func IsJSONArray(v []byte) bool
- func IsJSONObject(v []byte) bool
- func IsValidJSON(v []byte) bool
- func MustParseJSON(value string) map[string]interface{}
- func ParseJSON(value string, data map[string]interface{}) error
- func UnescapeJSON(v []byte) string
- type JsonDecodeError
Constants ¶
View Source
const (
// Separator character which is used when setting the path via a dot notation
Separator = "."
)
Variables ¶
View Source
var ErrJSONDecode = errors.New("failed to decode JSON")
View Source
var ErrOpenFile = errors.New("failed to open file")
View Source
var ErrReadFile = errors.New("failed to read file")
View Source
var ErrUnevenKeys = errors.New("Uneven number of key value pairs")
View Source
var Logger *logger.Logger
Logger is the package logger
Functions ¶
func DecodeJSONFile ¶
DecodeJSONFile returns the contents of a json file as a map
func IsJSONArray ¶
IsJSONArray returns true if the byte array represents a JSON array
func IsJSONObject ¶
IsJSONObject returns true if the byte array represents a JSON object
func IsValidJSON ¶
IsValidJSON returns true if the given byte array is a JSON array of JSON object
func MustParseJSON ¶
MustParseJSON parses a string and returns the map structure
func ParseJSON ¶
ParseJSON parses a string and returns the map structure. It will parse json and shorthand json.
func UnescapeJSON ¶
UnescapeJSON replaces unicode escape characters with the actual character
Types ¶
type JsonDecodeError ¶
type JsonDecodeError struct {
Err error
}
Click to show internal directories.
Click to hide internal directories.