Documentation ¶
Overview ¶
Package lookup provides a way to search and manipulate JSON files using simple JSON path expressions
Index ¶
- Variables
- func JSONAdd(filename, JSONpath, JSONdata string) error
- func JSONSet(filename, JSONpath, value string) error
- func JSONString(filename, JSONpath string) (string, error)
- type JSONFile
- func (jf *JSONFile) AddJSON(JSONpath, JSONdata string) error
- func (jf *JSONFile) Lookup(JSONpath string) (*simplejson.Json, error)
- func (jf *JSONFile) LookupString(JSONpath string) (string, error)
- func (jf *JSONFile) SetString(JSONpath, value string) error
- func (jf *JSONFile) Write(data []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSpecificNode = errors.New("Could not find a specific node that matched the given path")
)
Functions ¶
func JSONString ¶
JSONString will find the string that corresponds to the given JSON Path, given a filename and a simple JSON path expression.
Types ¶
type JSONFile ¶
type JSONFile struct {
// contains filtered or unexported fields
}
JSONFile represents a JSON file and contains the filename and root node
func NewJSONFile ¶
NewJSONFile will read the given filename and return a JSONFile struct
func (*JSONFile) LookupString ¶
LookupString will find the string that corresponds to the given JSON Path
Click to show internal directories.
Click to hide internal directories.