Documentation
¶
Index ¶
- type Container
- func (container *Container) ArrayAppendOrCreate(value interface{}, path ...string) (err error)
- func (container *Container) ArrayAppendOrCreateP(value interface{}, path string) error
- func (container *Container) GetMissingPaths(paths ...string) (missingPaths []string)
- func (container *Container) LogAndSetError(format string, a ...interface{})
- func (container *Container) PopPath(path string) *Container
- func (container *Container) Search(hierarchy ...string) *Container
- func (container *Container) SetValueIfPathExists(path string, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
Container encapsulates gabs.Container
func ParseJSON ¶
ParseJSON parses a string into a representation of the parsed JSON in gabs and returns our container
func (*Container) ArrayAppendOrCreate ¶
ArrayAppendOrCreate - Append a value onto a JSON array or create one with the provided value if the array does not yet exists.
func (*Container) ArrayAppendOrCreateP ¶
ArrayAppendOrCreateP - Append a value onto a JSON array using a dot notation JSON path or create one with the provided value if the array does not yet exists.
func (*Container) GetMissingPaths ¶
GetMissingPaths returns a list of specified paths not found in the specified container
func (*Container) LogAndSetError ¶
LogAndSetError - Formats the message, log it and appends to the container's error path
func (*Container) Search ¶
Search - Attempt to find and return an object within the JSON structure by specifying the hierarchy of field names to locate the target. If the search encounters an array and has not reached the end target then it will iterate each object of the array for the target and return all of the results in a JSON array.
func (*Container) SetValueIfPathExists ¶
SetValueIfPathExists sets the value to the specified path if it exists