{"modulePath":"github.com/UnityTech/client-go","version":"v11.0.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package jsonpath\n\npackage jsonpath is a template engine using jsonpath syntax, which can be seen at [http://goessner.net/articles/JsonPath/](http://goessner.net/articles/JsonPath/). In addition, it has {range} {end} function to iterate list and slice.\n\n## Variables\n\n```go\nvar (\n\tErrSyntax = errors.New(\"invalid syntax\")\n)\n```\n\n```go\nvar NodeTypeName = map[NodeType]string{\n\tNodeText:       \"NodeText\",\n\tNodeArray:      \"NodeArray\",\n\tNodeList:       \"NodeList\",\n\tNodeField:      \"NodeField\",\n\tNodeIdentifier: \"NodeIdentifier\",\n\tNodeFilter:     \"NodeFilter\",\n\tNodeInt:        \"NodeInt\",\n\tNodeFloat:      \"NodeFloat\",\n\tNodeWildcard:   \"NodeWildcard\",\n\tNodeRecursive:  \"NodeRecursive\",\n\tNodeUnion:      \"NodeUnion\",\n\tNodeBool:       \"NodeBool\",\n}\n```\n\n## Functions\n\n```go\nfunc UnquoteExtend(s string) (string, error)\n```\nUnquoteExtend is almost same as strconv.Unquote(), but it support parse single quotes as a string\n\n## Types\n\n```go\ntype ArrayNode struct {\n\tNodeType\n\tParams [3]ParamsEntry // start, end, step\n}\n```\nArrayNode holds start, end, step information for array index selection\n\n```go\nfunc (a *ArrayNode) String() string\n```\n\n```go\ntype BoolNode struct {\n\tNodeType\n\tValue bool\n}\n```\nBoolNode holds bool value\n\n```go\nfunc (b *BoolNode) String() string\n```\n\n```go\ntype FieldNode struct {\n\tNodeType\n\tValue string\n}\n```\nFieldNode holds field of struct\n\n```go\nfunc (f *FieldNode) String() string\n```\n\n```go\ntype FilterNode struct {\n\tNodeType\n\tLeft     *ListNode\n\tRight    *ListNode\n\tOperator string\n}\n```\nFilterNode holds operand and operator information for filter\n\n```go\nfunc (f *FilterNode) String() string\n```\n\n```go\ntype FloatNode struct {\n\tNodeType\n\tValue float64\n}\n```\nFloatNode holds float value\n\n```go\nfunc (i *FloatNode) String() string\n```\n\n```go\ntype IdentifierNode struct {\n\tNodeType\n\tName string\n}\n```\nIdentifierNode holds an identifier\n\n```go\nfunc (f *IdentifierNode) String() string\n```\n\n```go\ntype IntNode struct {\n\tNodeType\n\tValue int\n}\n```\nIntNode holds integer value\n\n```go\nfunc (i *IntNode) String() string\n```\n\n```go\ntype JSONPath struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc New(name string) *JSONPath\n```\nNew creates a new JSONPath with the given name.\n\n```go\nfunc (j *JSONPath) AllowMissingKeys(allow bool) *JSONPath\n```\nAllowMissingKeys allows a caller to specify whether they want an error if a field or map key cannot be located, or simply an empty result. The receiver is returned for chaining.\n\n```go\nfunc (j *JSONPath) Execute(wr io.Writer, data interface{}) error\n```\nExecute bounds data into template and writes the result.\n\n```go\nfunc (j *JSONPath) FindResults(data interface{}) ([][]reflect.Value, error)\n```\n\n```go\nfunc (j *JSONPath) Parse(text string) error\n```\nParse parses the given template and returns an error.\n\n```go\nfunc (j *JSONPath) PrintResults(wr io.Writer, results []reflect.Value) error\n```\nPrintResults writes the results into writer\n\n```go\ntype ListNode struct {\n\tNodeType\n\tNodes []Node // The element nodes in lexical order.\n}\n```\nListNode holds a sequence of nodes.\n\n```go\nfunc (l *ListNode) String() string\n```\n\n```go\ntype Node interface {\n\tType() NodeType\n\tString() string\n}\n```\n\n```go\ntype NodeType int\n```\nNodeType identifies the type of a parse tree node.\n\n```go\nconst (\n\tNodeText NodeType = iota\n\tNodeArray\n\tNodeList\n\tNodeField\n\tNodeIdentifier\n\tNodeFilter\n\tNodeInt\n\tNodeFloat\n\tNodeWildcard\n\tNodeRecursive\n\tNodeUnion\n\tNodeBool\n)\n```\n\n```go\nfunc (t NodeType) String() string\n```\n\n```go\nfunc (t NodeType) Type() NodeType\n```\nType returns itself and provides an easy default implementation\n\n```go\ntype ParamsEntry struct {\n\tValue   int\n\tKnown   bool // whether the value is known when parse it\n\tDerived bool\n}\n```\nParamsEntry holds param information for ArrayNode\n\n```go\ntype Parser struct {\n\tName string\n\tRoot *ListNode\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewParser(name string) *Parser\n```\n\n```go\nfunc Parse(name, text string) (*Parser, error)\n```\nParse parsed the given text and return a node Parser. If an error is encountered, parsing stops and an empty Parser is returned with the error\n\n```go\nfunc (p *Parser) Parse(text string) error\n```\n\n```go\ntype RecursiveNode struct {\n\tNodeType\n}\n```\nRecursiveNode means a recursive descent operator\n\n```go\nfunc (r *RecursiveNode) String() string\n```\n\n```go\ntype TextNode struct {\n\tNodeType\n\tText string // The text; may span newlines.\n}\n```\nTextNode holds plain text.\n\n```go\nfunc (t *TextNode) String() string\n```\n\n```go\ntype UnionNode struct {\n\tNodeType\n\tNodes []*ListNode\n}\n```\nUnionNode is union of ListNode\n\n```go\nfunc (u *UnionNode) String() string\n```\n\n```go\ntype WildcardNode struct {\n\tNodeType\n}\n```\nWildcardNode means a wildcard\n\n```go\nfunc (i *WildcardNode) String() string\n```\n\n","path":"github.com/UnityTech/client-go/util/jsonpath","name":"jsonpath","synopsis":"package jsonpath is a template engine using jsonpath syntax, which can be seen at http://goessner.net/articles/JsonPath/.","isRedistributable":true}
