package
0.0.0-20240624165312-d509b34c5379
Repository: https://github.com/sanity-io/go-groq.git
Documentation: pkg.go.dev
# Functions
AreAllExpressions returns true if all expressions satisfy a function.
No description provided by the author
No description provided by the author
No description provided by the author
AttributeAliasFromExpr will return "bar" for "bar" or "foo.bar".
No description provided by the author
No description provided by the author
Contains is like Walk(), except its return value is the reverse: If the walk visitor returns true, walking is aborted, and the function returns true.
No description provided by the author
InterfaceFromLiteral returns a value from a Literal interface.
No description provided by the author
IsArithmeticOperator checks whether an operator is an arithmetic operator.
No description provided by the author
No description provided by the author
No description provided by the author
IsSubscriptExpression checks whether an expression is a valid subscript expression.
No description provided by the author
LiteralFromInterface takes a value and returns a value wrapped in a Literal interface.
MatchingBrace returns the brace matching the provided token, as in '(' returns ')' and '[' returns ']'.
No description provided by the author
Transform walks an expression depth-first.
No description provided by the author
Walk walks an expression top-down, i.e.
# Constants
&&.
->.
asc.
*.
@.
true or false.
{.
}.
[.
].
:.
,.
desc.
.
..
...
::.
End of File.
==.
=.
**.
123.4.
>.
>=.
^.
The different tokens.
in.
1234.
No description provided by the author
No description provided by the author
No description provided by the author
<.
<=.
match.
-.
A valid field or type identifier.
!=.
!.
null.
||.
(.
).
%.
|.
+.
=>.
;.
/.
'literal string' or "literal string".
Always last.
A contiguous sequence of white space.
# Structs
Array is a an array on the form `[a, b, 1, 2, 3]`.
ArrayTraversal marks the expression for array traversal.
Attribute represents specification of a field on the form `title` as in `book.title`.
BinaryOperator represents two expressions joint with an operator.
BooleanLiteral is a literal bool.
A Constraint operation, on the form `*[is "article" && expiresAt < $now && _createdAt desc]`.
DotOperator is a convenience class for the common operator '.'.
Element returns an indexed element of an array.
Ellipsis represents a '...'-statement.
Everything is the `*`, the root of all queries.
A Filter filters an array using another expression.
FloatLiteral is literal float.
FunctionCall represents a function invocation on the form function(expression).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A FunctionPipe maps an object or array of objects through a function.
Group is a node inserted around an expression to indicate places where explicit parentheses have special meaning.
IntegerLiteral is literal integer.
NullLiteral is a literal null.
Object is a `{title, body, somethingsomething}`.
Param represents a placeholder parameter, e.g.
Parent is the `^`, the item being processed in a mapping operation.
ParseError represents an error during parsing.
PipeOperator is a convenience class for the very common operator '|'.
Position represents a position in the source code.
PostfixOperator represents an expression followed by an operator `_createdAt desc`.
PrefixOperator represents a prefix operator `!completed`.
A Projection maps an object or array of objects to a new object.
Range is a literal range expression on the form `[1..10]` (inclusive), `[1...10]` (exclusive).
Slice retrieves a range of an array.
StringLiteral is literal strings.
Subscript is on the form `[0]`.
This `@` is the current root value of the scope.
Tuple represents parenthesized expression: (foo, bar).
# Interfaces
Expression is the common interface for all GROQ expressions.
Literal is the common interface implemented by all literal nodes.