Documentation ¶
Index ¶
- func NewInvalidNodeStructureError(name string, n *parser.Node) error
- type AbsSingularQuery
- type BasicExpr
- type Boolean
- type BracketedSelection
- type ChildSegment
- type Comparable
- type ComparisonExpr
- type DescendantSegment
- type FilterSelector
- type FunctionArgument
- type FunctionExpr
- type IndexSegment
- type IndexSelector
- type InvalidNodeStructure
- type JSONPathQuery
- type Literal
- type LogicalAndExpr
- type LogicalExpr
- type MemberNameShorthand
- type NameSegment
- type NameSelector
- type Null
- type Number
- type ParenExpr
- type RelQuery
- type RelSingularQuery
- type Segment
- type Selector
- type SingularQuerySegment
- type SliceSelector
- type String
- type TestExpr
- type TestExpression
- type WildcardSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AbsSingularQuery ¶
type AbsSingularQuery struct {
Segments []SingularQuerySegment
}
func ParseAbsSingularQuery ¶
func ParseAbsSingularQuery(n *parser.Node) (*AbsSingularQuery, error)
func (AbsSingularQuery) String ¶
func (s AbsSingularQuery) String() string
type Boolean ¶
type Boolean bool
Boolean = true / false true = %x74.72.75.65 false = %x66.61.6c.73.65
type BracketedSelection ¶
type BracketedSelection struct {
Selectors []Selector
}
func ParseBracketedSelection ¶
func ParseBracketedSelection(n *parser.Node) (*BracketedSelection, error)
func (BracketedSelection) String ¶
func (s BracketedSelection) String() string
type ChildSegment ¶
type ChildSegment interface { Segment // contains filtered or unexported methods }
func ParseChildSegment ¶
func ParseChildSegment(n *parser.Node) (ChildSegment, error)
type Comparable ¶
type Comparable interface { fmt.Stringer Value(ref any) (any, error) // contains filtered or unexported methods }
func ParseComparable ¶
func ParseComparable(n *parser.Node) (Comparable, error)
type ComparisonExpr ¶
type ComparisonExpr struct {
Left, Right Comparable
Op string
}
func ParseComparisonExpr ¶
func ParseComparisonExpr(n *parser.Node) (*ComparisonExpr, error)
func (ComparisonExpr) String ¶
func (s ComparisonExpr) String() string
type DescendantSegment ¶
type DescendantSegment struct {
Segment Segment
}
func ParseDescendantSegment ¶
func ParseDescendantSegment(n *parser.Node) (*DescendantSegment, error)
func (DescendantSegment) String ¶
func (s DescendantSegment) String() string
type FilterSelector ¶
type FilterSelector struct {
LogicalExpr *LogicalExpr
}
func ParseFilterSelector ¶
func ParseFilterSelector(n *parser.Node) (*FilterSelector, error)
func (FilterSelector) String ¶
func (s FilterSelector) String() string
type FunctionArgument ¶
func ParseFunctionArgument ¶
func ParseFunctionArgument(n *parser.Node) (FunctionArgument, error)
type FunctionExpr ¶
type FunctionExpr struct { Name string Arguments []FunctionArgument }
func ParseFunctionExpr ¶
func ParseFunctionExpr(n *parser.Node) (*FunctionExpr, error)
func (FunctionExpr) String ¶
func (s FunctionExpr) String() string
type IndexSegment ¶
type IndexSegment struct {
Selector *IndexSelector
}
func ParseIndexSegment ¶
func ParseIndexSegment(n *parser.Node) (*IndexSegment, error)
func (IndexSegment) String ¶
func (s IndexSegment) String() string
type IndexSelector ¶
type IndexSelector struct {
Index int
}
func ParseIndexSelector ¶
func ParseIndexSelector(n *parser.Node) (*IndexSelector, error)
func (IndexSelector) String ¶
func (s IndexSelector) String() string
type InvalidNodeStructure ¶
func (InvalidNodeStructure) Error ¶
func (e InvalidNodeStructure) Error() string
type JSONPathQuery ¶
type JSONPathQuery struct {
Segments []Segment
}
func ParseJSONPathQuery ¶
func ParseJSONPathQuery(n *parser.Node) (*JSONPathQuery, error)
func (JSONPathQuery) String ¶
func (q JSONPathQuery) String() string
type Literal ¶
type Literal interface { // Comparable = literal / ... Comparable // FunctionArgument = literal / ... FunctionArgument // contains filtered or unexported methods }
type LogicalAndExpr ¶
type LogicalAndExpr struct {
Expressions []BasicExpr
}
func ParseLogicalAndExpr ¶
func ParseLogicalAndExpr(n *parser.Node) (*LogicalAndExpr, error)
func (LogicalAndExpr) String ¶
func (s LogicalAndExpr) String() string
type LogicalExpr ¶
type LogicalExpr struct {
Expressions []*LogicalAndExpr
}
func ParseLogicalExpr ¶
func ParseLogicalExpr(n *parser.Node) (*LogicalExpr, error)
func (LogicalExpr) String ¶
func (s LogicalExpr) String() string
type MemberNameShorthand ¶
type MemberNameShorthand struct {
Name string
}
func (MemberNameShorthand) String ¶
func (s MemberNameShorthand) String() string
type NameSegment ¶
type NameSegment struct {
Name string
}
func ParseNameSegment ¶
func ParseNameSegment(n *parser.Node) (*NameSegment, error)
func (NameSegment) String ¶
func (s NameSegment) String() string
type NameSelector ¶
type NameSelector struct {
Name string
}
func ParseNameSelector ¶
func ParseNameSelector(n *parser.Node) (*NameSelector, error)
func (NameSelector) String ¶
func (s NameSelector) String() string
type Number ¶
Number = (int / "-0") [ frac ] [ exp ] ; decimal number int = "0" / (["-"] DIGIT1 *DIGIT) ; - optional DIGIT = %x30-39 ; 0-9 DIGIT1 = %x31-39 ; 1-9 non-zero digit frac = "." 1*DIGIT ; decimal fraction exp = "e" [ "-" / "+" ] 1*DIGIT ; decimal exponent
type ParenExpr ¶
type ParenExpr struct { Negation bool LogicalExpr *LogicalExpr }
type RelSingularQuery ¶
type RelSingularQuery struct {
Segments []SingularQuerySegment
}
func ParseRelSingularQuery ¶
func ParseRelSingularQuery(n *parser.Node) (*RelSingularQuery, error)
func (RelSingularQuery) String ¶
func (s RelSingularQuery) String() string
type SingularQuerySegment ¶
type SingularQuerySegment interface { fmt.Stringer Value(ref any) (any, error) // contains filtered or unexported methods }
func ParseSingularQuerySegments ¶
func ParseSingularQuerySegments(n *parser.Node) ([]SingularQuerySegment, error)
type SliceSelector ¶
type SliceSelector struct {
Start, End, Step int
}
func ParseSliceSelector ¶
func ParseSliceSelector(n *parser.Node) (*SliceSelector, error)
func (SliceSelector) String ¶
func (s SliceSelector) String() string
type String ¶
type String string
String = %x22 *double-quoted %x22 / %x27 *single-quoted %x27 ; 'string' double-quoted = unescaped / %x27 / ESC %x22 / ESC escapable single-quoted = unescaped / %x22 / ESC %x27 / ESC escapable ESC = %x5C unescaped = %x20-21 / %x23-26 / %x28-5B / %x5D-D7FF / %xE000-10FFFF escapable = %x62 / %x66 / %x6E / %x72 / %x74 / "/" / "\" / (%x75 hexchar) hexchar = non-surrogate / (high-surrogate "\" %x75 low-surrogate) non-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) / ("D" %x30-37 2HEXDIG ) high-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG low-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
type TestExpr ¶
type TestExpr struct { Negation bool TestExpr TestExpression }
type TestExpression ¶
type WildcardSelector ¶
type WildcardSelector struct{}
func (WildcardSelector) String ¶
func (s WildcardSelector) String() string