Documentation ¶
Index ¶
- Constants
- func Parse(filename string, b []byte, opts ...Option) (interface{}, error)
- func ParseFile(filename string, opts ...Option) (interface{}, error)
- func ParseReader(filename string, r io.Reader, opts ...Option) (interface{}, error)
- type Block
- type Chained
- type Filter
- type Generator
- type HeaderItem
- type HeaderValue
- type KeyValue
- type Match
- type MaxAgeValue
- type ObjectEntry
- type Option
- type ParameterBody
- type Parameters
- type Primitive
- type Qualifier
- type Query
- type SMaxAgeValue
- type TimeoutValue
- type Use
- type UseValue
- type Value
Constants ¶
const ( FromMethod = "from" IntoMethod = "into" UpdateMethod = "update" ToMethod = "to" DeleteMethod = "delete" WithKeyword = "with" OnlyKeyword = "only" HeadersKeyword = "headers" HiddenKeyword = "hidden" TimeoutKeyword = "timeout" MaxAgeKeyword = "max-age" SmaxAgeKeyword = "s-max-age" IgnoreErrorsKeyword = "ignore-errors" NoMultiplex = "no-multiplex" Base64 = "base64" JSON = "json" AsBody = "as-body" Flatten = "flatten" )
restQL language keywords.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Generator ¶
type Generator struct{}
Generator encapsulate the parsing implementation used to transform a query string into an AST.
type HeaderItem ¶
type HeaderItem struct { Key string Value HeaderValue }
HeaderItem is the syntax node representing an entry of the `headers` clause.
type HeaderValue ¶
HeaderValue is the syntax node representing a `headers` clause entry value.
type MaxAgeValue ¶
type MaxAgeValue variableOrInt
MaxAgeValue is the syntax node representing the value in the `max-age` clause.
type ObjectEntry ¶
ObjectEntry is the syntax node representing an object value.
type Option ¶
type Option func(*parser) Option
Option is a function that can set an option on the parser. It returns the previous setting as an Option.
func Debug ¶
Debug creates an Option to set the debug flag to b. When set to true, debugging information is printed to stdout while parsing.
The default is false.
func Memoize ¶
Memoize creates an Option to set the memoize flag to b. When set to true, the parser will cache all results so each expression is evaluated only once. This guarantees linear parsing time even for pathological cases, at the expense of more memory and slower times for typical cases.
The default is false.
type ParameterBody ¶
ParameterBody is the syntax node representing the dynamic body feature of the `with` clause.
type Parameters ¶
type Parameters struct { Body *ParameterBody KeyValues []KeyValue }
Parameters is the syntax node representing the `with` clause.
type Primitive ¶
type Primitive struct { String *string Int *int Float *float64 Boolean *bool Chain []Chained Null bool }
Primitive is the syntax node representing the basic restQL value types.
type Qualifier ¶
type Qualifier struct { With *Parameters Only []Filter Headers []HeaderItem Hidden bool Timeout *TimeoutValue MaxAge *MaxAgeValue SMaxAge *SMaxAgeValue IgnoreErrors bool }
Qualifier is the syntax node representing statement clauses: `with`, `only`, `hidden`, `headers`, `timeout` `max-age`, `s-max-age` and `ignore-errors`.
type SMaxAgeValue ¶
type SMaxAgeValue variableOrInt
SMaxAgeValue is the syntax node representing the value in the `s-max-age` clause.
type TimeoutValue ¶
type TimeoutValue variableOrInt
TimeoutValue is the syntax node representing the value in the `timeout` clause.