package jmespath
import "k8s.io/kubernetes/Godeps/_workspace/src/github.com/jmespath/go-jmespath"
Index ¶
- Constants
- func Search(expression string, data interface{}) (interface{}, error)
- type ASTNode
- type Lexer
- type Parser
- type SyntaxError
Constants ¶
const ( ASTEmpty astNodeType = iota ASTComparator ASTCurrentNode ASTExpRef ASTFunctionExpression ASTField ASTFilterProjection ASTFlatten ASTIdentity ASTIndex ASTIndexExpression ASTKeyValPair ASTLiteral ASTMultiSelectHash ASTMultiSelectList ASTOrExpression ASTAndExpression ASTNotExpression ASTPipe ASTProjection ASTSubexpression ASTSlice ASTValueProjection )
Functions ¶
func Search ¶
Search evaluates a JMESPath expression against input data and returns the result.
Types ¶
type ASTNode ¶
type ASTNode struct {
// contains filtered or unexported fields
}
ASTNode represents the abstract syntax tree of a JMESPath expression.
func (ASTNode) PrettyPrint ¶
PrettyPrint will pretty print the parsed AST. The AST is an implementation detail and this pretty print function is provided as a convenience method to help with debugging. You should not rely on its output as the internal structure of the AST may change at any time.
func (ASTNode) String ¶
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer contains information about the expression being tokenized.
func NewLexer ¶
func NewLexer() *Lexer
NewLexer creates a new JMESPath lexer.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser holds state about the current expression being parsed.
func NewParser ¶
func NewParser() *Parser
NewParser creates a new JMESPath parser.
func (*Parser) Parse ¶
Parse will compile a JMESPath expression.
type SyntaxError ¶
type SyntaxError struct { Expression string // Expression that generated a SyntaxError Offset int // The location in the string where the error occurred // contains filtered or unexported fields }
SyntaxError is the main error used whenever a lexing or parsing error occurs.
func (SyntaxError) Error ¶
func (e SyntaxError) Error() string
func (SyntaxError) HighlightLocation ¶
func (e SyntaxError) HighlightLocation() string
HighlightLocation will show where the syntax error occurred. It will place a "^" character on a line below the expression at the point where the syntax error occurred.
Source Files ¶
api.go astnodetype_string.go functions.go interpreter.go lexer.go parser.go toktype_string.go util.go
Directories ¶
Path | Synopsis |
---|---|
Godeps/_workspace/src/github.com/jmespath/go-jmespath/cmd | |
Godeps/_workspace/src/github.com/jmespath/go-jmespath/cmd/jpgo | Basic command line interface for debug and testing purposes. |
Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz |
- Version
- v1.2.0-alpha.6
- Published
- Jan 13, 2016
- Platform
- js/wasm
- Imports
- 11 packages
- Last checked
- 5 seconds ago –
Tools for package owners.