Documentation
¶
Index ¶
- Variables
- type ArrayExpression
- type ArrowFunctionExpression
- type BaseNode
- type BinaryExpression
- type BlockStatement
- type BooleanLiteral
- type CallExpression
- type ConditionalExpression
- type DateTimeLiteral
- type DurationLiteral
- type Expression
- type ExpressionStatement
- type FloatLiteral
- type Identifier
- type IntegerLiteral
- type Literal
- type LogicalExpression
- type LogicalOperatorKind
- type MemberExpression
- type Node
- type ObjectExpression
- type OperatorKind
- type PipeExpression
- type PipeLiteral
- type Position
- type Program
- type Property
- type RegexpLiteral
- type ReturnStatement
- type SourceLocation
- type Statement
- type StringLiteral
- type UnaryExpression
- type UnsignedIntegerLiteral
- type VariableDeclaration
- type VariableDeclarator
Constants ¶
This section is empty.
Variables ¶
var LogicalOperatorTokens = map[LogicalOperatorKind]string{ AndOperator: "and", OrOperator: "or", }
LogicalOperatorTokens converts LogicalOperatorKind to string
var OperatorTokens = map[OperatorKind]string{ MultiplicationOperator: "*", DivisionOperator: "/", AdditionOperator: "+", SubtractionOperator: "-", LessThanEqualOperator: "<=", LessThanOperator: "<", GreaterThanOperator: ">", GreaterThanEqualOperator: ">=", InOperator: "in", NotOperator: "not", NotEmptyOperator: "not empty", EmptyOperator: "empty", StartsWithOperator: "startswith", EqualOperator: "==", NotEqualOperator: "!=", RegexpMatchOperator: "=~", NotRegexpMatchOperator: "!~", }
OperatorTokens converts OperatorKind to string
Functions ¶
This section is empty.
Types ¶
type ArrayExpression ¶
type ArrayExpression struct { *BaseNode Elements []Expression `json:"elements"` }
ArrayExpression is used to create and directly specify the elements of an array object
func (*ArrayExpression) Copy ¶ added in v0.0.4
func (e *ArrayExpression) Copy() Node
func (*ArrayExpression) MarshalJSON ¶ added in v0.0.4
func (e *ArrayExpression) MarshalJSON() ([]byte, error)
func (*ArrayExpression) UnmarshalJSON ¶ added in v0.0.4
func (e *ArrayExpression) UnmarshalJSON(data []byte) error
type ArrowFunctionExpression ¶ added in v0.0.4
type ArrowFunctionExpression struct { *BaseNode Params []*Property `json:"params"` Body Node `json:"body"` }
func (*ArrowFunctionExpression) Copy ¶ added in v0.0.4
func (e *ArrowFunctionExpression) Copy() Node
func (*ArrowFunctionExpression) MarshalJSON ¶ added in v0.0.4
func (e *ArrowFunctionExpression) MarshalJSON() ([]byte, error)
func (*ArrowFunctionExpression) Type ¶ added in v0.0.4
func (*ArrowFunctionExpression) Type() string
Type is the abstract type
func (*ArrowFunctionExpression) UnmarshalJSON ¶ added in v0.0.4
func (e *ArrowFunctionExpression) UnmarshalJSON(data []byte) error
type BaseNode ¶
type BaseNode struct {
Loc *SourceLocation `json:"location,omitempty"`
}
BaseNode holds the attributes every expression or statement should have
func (*BaseNode) Location ¶
func (b *BaseNode) Location() *SourceLocation
Location is the source location of the Node
type BinaryExpression ¶
type BinaryExpression struct { *BaseNode Operator OperatorKind `json:"operator"` Left Expression `json:"left"` Right Expression `json:"right"` }
BinaryExpression use binary operators act on two operands in an expression. BinaryExpression includes relational and arithmatic operators
func (*BinaryExpression) Copy ¶ added in v0.0.4
func (e *BinaryExpression) Copy() Node
func (*BinaryExpression) MarshalJSON ¶ added in v0.0.4
func (e *BinaryExpression) MarshalJSON() ([]byte, error)
func (*BinaryExpression) UnmarshalJSON ¶ added in v0.0.4
func (e *BinaryExpression) UnmarshalJSON(data []byte) error
type BlockStatement ¶ added in v0.0.4
BlockStatement is a set of statements
func (*BlockStatement) Copy ¶ added in v0.0.4
func (s *BlockStatement) Copy() Node
func (*BlockStatement) MarshalJSON ¶ added in v0.0.4
func (s *BlockStatement) MarshalJSON() ([]byte, error)
func (*BlockStatement) Type ¶ added in v0.0.4
func (*BlockStatement) Type() string
Type is the abstract type
func (*BlockStatement) UnmarshalJSON ¶ added in v0.0.4
func (s *BlockStatement) UnmarshalJSON(data []byte) error
type BooleanLiteral ¶
BooleanLiteral represent boolean values
func (*BooleanLiteral) Copy ¶ added in v0.0.4
func (l *BooleanLiteral) Copy() Node
func (*BooleanLiteral) MarshalJSON ¶ added in v0.0.4
func (l *BooleanLiteral) MarshalJSON() ([]byte, error)
type CallExpression ¶
type CallExpression struct { *BaseNode Callee Expression `json:"callee"` Arguments []Expression `json:"arguments,omitempty"` }
CallExpression represents a function all whose callee may be an Identifier or MemberExpression
func (*CallExpression) Copy ¶ added in v0.0.4
func (e *CallExpression) Copy() Node
func (*CallExpression) MarshalJSON ¶ added in v0.0.4
func (e *CallExpression) MarshalJSON() ([]byte, error)
func (*CallExpression) UnmarshalJSON ¶ added in v0.0.4
func (e *CallExpression) UnmarshalJSON(data []byte) error
type ConditionalExpression ¶
type ConditionalExpression struct { *BaseNode Test Expression `json:"test"` Alternate Expression `json:"alternate"` Consequent Expression `json:"consequent"` }
ConditionalExpression selects one of two expressions, `Alternate` or `Consequent` depending on a third, boolean, expression, `Test`.
func (*ConditionalExpression) Copy ¶ added in v0.0.4
func (e *ConditionalExpression) Copy() Node
func (*ConditionalExpression) MarshalJSON ¶ added in v0.0.4
func (e *ConditionalExpression) MarshalJSON() ([]byte, error)
func (*ConditionalExpression) Type ¶
func (*ConditionalExpression) Type() string
Type is the abstract type
func (*ConditionalExpression) UnmarshalJSON ¶ added in v0.0.4
func (e *ConditionalExpression) UnmarshalJSON(data []byte) error
type DateTimeLiteral ¶
DateTimeLiteral represents an instant in time with nanosecond precision using the syntax of golang's RFC3339 Nanosecond variant TODO: this may be better as a class initialization
func (*DateTimeLiteral) Copy ¶ added in v0.0.4
func (l *DateTimeLiteral) Copy() Node
func (*DateTimeLiteral) MarshalJSON ¶ added in v0.0.4
func (l *DateTimeLiteral) MarshalJSON() ([]byte, error)
type DurationLiteral ¶
DurationLiteral represents the elapsed time between two instants as an int64 nanosecond count with syntax of golang's time.Duration TODO: this may be better as a class initialization
func (*DurationLiteral) Copy ¶ added in v0.0.4
func (l *DurationLiteral) Copy() Node
func (*DurationLiteral) MarshalJSON ¶ added in v0.0.4
func (l *DurationLiteral) MarshalJSON() ([]byte, error)
func (*DurationLiteral) UnmarshalJSON ¶ added in v0.0.4
func (l *DurationLiteral) UnmarshalJSON(data []byte) error
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
Expression represents an action that can be performed by InfluxDB that can be evaluated to a value.
type ExpressionStatement ¶
type ExpressionStatement struct { *BaseNode Expression Expression `json:"expression"` }
ExpressionStatement may consist of an expression that does not return a value and is executed solely for its side-effects.
func (*ExpressionStatement) Copy ¶ added in v0.0.4
func (s *ExpressionStatement) Copy() Node
func (*ExpressionStatement) MarshalJSON ¶ added in v0.0.4
func (s *ExpressionStatement) MarshalJSON() ([]byte, error)
func (*ExpressionStatement) Type ¶
func (*ExpressionStatement) Type() string
Type is the abstract type
func (*ExpressionStatement) UnmarshalJSON ¶ added in v0.0.4
func (s *ExpressionStatement) UnmarshalJSON(data []byte) error
type FloatLiteral ¶ added in v0.0.4
FloatLiteral represent floating point numbers according to the double representations defined by the IEEE-754-1985
func (*FloatLiteral) Copy ¶ added in v0.0.4
func (l *FloatLiteral) Copy() Node
func (*FloatLiteral) MarshalJSON ¶ added in v0.0.4
func (l *FloatLiteral) MarshalJSON() ([]byte, error)
func (*FloatLiteral) Type ¶ added in v0.0.4
func (*FloatLiteral) Type() string
Type is the abstract type
type Identifier ¶
Identifier represents a name that identifies a unique Node
func (*Identifier) Copy ¶ added in v0.0.4
func (i *Identifier) Copy() Node
func (*Identifier) MarshalJSON ¶ added in v0.0.4
func (i *Identifier) MarshalJSON() ([]byte, error)
type IntegerLiteral ¶
IntegerLiteral represent integer numbers.
func (*IntegerLiteral) Copy ¶ added in v0.0.4
func (l *IntegerLiteral) Copy() Node
func (*IntegerLiteral) MarshalJSON ¶ added in v0.0.4
func (l *IntegerLiteral) MarshalJSON() ([]byte, error)
func (*IntegerLiteral) UnmarshalJSON ¶ added in v0.0.4
func (l *IntegerLiteral) UnmarshalJSON(data []byte) error
type Literal ¶
type Literal interface { Expression // contains filtered or unexported methods }
Literal are thelexical forms for literal expressions which define boolean, string, integer, number, duration, datetime and field values. Literals must be coerced explicitly.
type LogicalExpression ¶
type LogicalExpression struct { *BaseNode Operator LogicalOperatorKind `json:"operator"` Left Expression `json:"left"` Right Expression `json:"right"` }
LogicalExpression represent the rule conditions that collectively evaluate to either true or false. `or` expressions compute the disjunction of two boolean expressions and return boolean values. `and“ expressions compute the conjunction of two boolean expressions and return boolean values.
func (*LogicalExpression) Copy ¶ added in v0.0.4
func (e *LogicalExpression) Copy() Node
func (*LogicalExpression) MarshalJSON ¶ added in v0.0.4
func (e *LogicalExpression) MarshalJSON() ([]byte, error)
func (*LogicalExpression) UnmarshalJSON ¶ added in v0.0.4
func (e *LogicalExpression) UnmarshalJSON(data []byte) error
type LogicalOperatorKind ¶
type LogicalOperatorKind int
LogicalOperatorKind are used with boolean (logical) values
const ( AndOperator LogicalOperatorKind OrOperator )
func LogicalOperatorLookup ¶
func LogicalOperatorLookup(op string) LogicalOperatorKind
LogicalOperatorLookup converts the operators to LogicalOperatorKind
func (LogicalOperatorKind) MarshalText ¶ added in v0.0.4
func (o LogicalOperatorKind) MarshalText() ([]byte, error)
func (LogicalOperatorKind) String ¶
func (o LogicalOperatorKind) String() string
func (*LogicalOperatorKind) UnmarshalText ¶ added in v0.0.4
func (o *LogicalOperatorKind) UnmarshalText(data []byte) error
type MemberExpression ¶
type MemberExpression struct { *BaseNode Object Expression `json:"object"` Property Expression `json:"property"` }
MemberExpression represents calling a property of a CallExpression
func (*MemberExpression) Copy ¶ added in v0.0.4
func (e *MemberExpression) Copy() Node
func (*MemberExpression) MarshalJSON ¶ added in v0.0.4
func (e *MemberExpression) MarshalJSON() ([]byte, error)
func (*MemberExpression) UnmarshalJSON ¶ added in v0.0.4
func (e *MemberExpression) UnmarshalJSON(data []byte) error
type Node ¶
type Node interface { Type() string // Type property is a string that contains the variant type of the node Location() *SourceLocation Copy() Node // All node must support json marshalling json.Marshaler // contains filtered or unexported methods }
Node represents a node in the InfluxDB abstract syntax tree.
func UnmarshalNode ¶ added in v0.0.4
type ObjectExpression ¶
ObjectExpression allows the declaration of an anonymous object within a declaration.
func (*ObjectExpression) Copy ¶ added in v0.0.4
func (e *ObjectExpression) Copy() Node
func (*ObjectExpression) MarshalJSON ¶ added in v0.0.4
func (e *ObjectExpression) MarshalJSON() ([]byte, error)
type OperatorKind ¶
type OperatorKind int
OperatorKind are Equality and Arithmatic operators. Result of evaluating an equality operator is always of type Boolean based on whether the comparison is true Arithmetic operators take numerical values (either literals or variables) as their operands
and return a single numerical value.
const ( MultiplicationOperator OperatorKind DivisionOperator AdditionOperator SubtractionOperator LessThanEqualOperator LessThanOperator GreaterThanEqualOperator GreaterThanOperator StartsWithOperator InOperator NotOperator NotEmptyOperator EmptyOperator EqualOperator NotEqualOperator RegexpMatchOperator NotRegexpMatchOperator )
func OperatorLookup ¶
func OperatorLookup(op string) OperatorKind
OperatorLookup converts the operators to OperatorKind
func (OperatorKind) MarshalText ¶ added in v0.0.4
func (o OperatorKind) MarshalText() ([]byte, error)
func (OperatorKind) String ¶
func (o OperatorKind) String() string
func (*OperatorKind) UnmarshalText ¶ added in v0.0.4
func (o *OperatorKind) UnmarshalText(data []byte) error
type PipeExpression ¶ added in v0.0.5
type PipeExpression struct { *BaseNode Argument Expression `json:"argument"` Call *CallExpression `json:"call"` }
func (*PipeExpression) Copy ¶ added in v0.0.5
func (e *PipeExpression) Copy() Node
func (*PipeExpression) MarshalJSON ¶ added in v0.0.5
func (e *PipeExpression) MarshalJSON() ([]byte, error)
func (*PipeExpression) Type ¶ added in v0.0.5
func (*PipeExpression) Type() string
Type is the abstract type
func (*PipeExpression) UnmarshalJSON ¶ added in v0.0.5
func (e *PipeExpression) UnmarshalJSON(data []byte) error
type PipeLiteral ¶ added in v0.0.5
type PipeLiteral struct {
*BaseNode
}
PipeLiteral represents an specialized literal value, indicating the left hand value of a pipe expression.
func (*PipeLiteral) Copy ¶ added in v0.0.5
func (i *PipeLiteral) Copy() Node
func (*PipeLiteral) MarshalJSON ¶ added in v0.0.5
func (l *PipeLiteral) MarshalJSON() ([]byte, error)
func (*PipeLiteral) Type ¶ added in v0.0.5
func (*PipeLiteral) Type() string
Type is the abstract type
type Position ¶
type Position struct { Line int `json:"line"` // Line is the line in the source marked by this position Column int `json:"column"` // Column is the column in the source marked by this position }
Position represents a specific location in the source
type Program ¶
Program represents a complete program source tree
func (*Program) MarshalJSON ¶ added in v0.0.4
func (*Program) UnmarshalJSON ¶ added in v0.0.4
type Property ¶
type Property struct { *BaseNode Key *Identifier `json:"key"` Value Expression `json:"value"` }
Property is the value associated with a key
func (*Property) MarshalJSON ¶ added in v0.0.4
func (*Property) UnmarshalJSON ¶ added in v0.0.4
type RegexpLiteral ¶
RegexpLiteral expressions begin and end with `/` and are regular expressions with syntax accepted by RE2
func (*RegexpLiteral) Copy ¶ added in v0.0.4
func (l *RegexpLiteral) Copy() Node
func (*RegexpLiteral) MarshalJSON ¶ added in v0.0.4
func (l *RegexpLiteral) MarshalJSON() ([]byte, error)
func (*RegexpLiteral) UnmarshalJSON ¶ added in v0.0.4
func (l *RegexpLiteral) UnmarshalJSON(data []byte) error
type ReturnStatement ¶ added in v0.0.4
type ReturnStatement struct { *BaseNode Argument Expression `json:"argument"` }
ReturnStatement defines an Expression to return
func (*ReturnStatement) Copy ¶ added in v0.0.4
func (s *ReturnStatement) Copy() Node
func (*ReturnStatement) MarshalJSON ¶ added in v0.0.4
func (s *ReturnStatement) MarshalJSON() ([]byte, error)
func (*ReturnStatement) Type ¶ added in v0.0.4
func (*ReturnStatement) Type() string
Type is the abstract type
func (*ReturnStatement) UnmarshalJSON ¶ added in v0.0.4
func (s *ReturnStatement) UnmarshalJSON(data []byte) error
type SourceLocation ¶
type SourceLocation struct { Start Position `json:"start"` // Start is the location in the source the node starts End Position `json:"end"` // End is the location in the source the node ends Source *string `json:"source,omitempty"` // Source is optional raw source }
SourceLocation represents the location of a node in the AST
type Statement ¶
type Statement interface { Node // contains filtered or unexported methods }
Statement Perhaps we don't even want statements nor expression statements
type StringLiteral ¶
StringLiteral expressions begin and end with double quote marks.
func (*StringLiteral) Copy ¶ added in v0.0.4
func (l *StringLiteral) Copy() Node
func (*StringLiteral) MarshalJSON ¶ added in v0.0.4
func (l *StringLiteral) MarshalJSON() ([]byte, error)
func (*StringLiteral) Type ¶
func (*StringLiteral) Type() string
type UnaryExpression ¶ added in v0.0.4
type UnaryExpression struct { *BaseNode Operator OperatorKind `json:"operator"` Argument Expression `json:"argument"` }
UnaryExpression use operators act on a single operand in an expression.
func (*UnaryExpression) Copy ¶ added in v0.0.4
func (e *UnaryExpression) Copy() Node
func (*UnaryExpression) MarshalJSON ¶ added in v0.0.4
func (e *UnaryExpression) MarshalJSON() ([]byte, error)
func (*UnaryExpression) Type ¶ added in v0.0.4
func (*UnaryExpression) Type() string
Type is the abstract type
func (*UnaryExpression) UnmarshalJSON ¶ added in v0.0.4
func (e *UnaryExpression) UnmarshalJSON(data []byte) error
type UnsignedIntegerLiteral ¶ added in v0.0.4
UnsignedIntegerLiteral represent integer numbers.
func (*UnsignedIntegerLiteral) Copy ¶ added in v0.0.4
func (l *UnsignedIntegerLiteral) Copy() Node
func (*UnsignedIntegerLiteral) MarshalJSON ¶ added in v0.0.4
func (l *UnsignedIntegerLiteral) MarshalJSON() ([]byte, error)
func (*UnsignedIntegerLiteral) Type ¶ added in v0.0.4
func (*UnsignedIntegerLiteral) Type() string
Type is the abstract type
func (*UnsignedIntegerLiteral) UnmarshalJSON ¶ added in v0.0.4
func (l *UnsignedIntegerLiteral) UnmarshalJSON(data []byte) error
type VariableDeclaration ¶
type VariableDeclaration struct { *BaseNode Declarations []*VariableDeclarator `json:"declarations"` }
VariableDeclaration declares one or more variables using assignment
func (*VariableDeclaration) Copy ¶ added in v0.0.4
func (d *VariableDeclaration) Copy() Node
func (*VariableDeclaration) MarshalJSON ¶ added in v0.0.4
func (d *VariableDeclaration) MarshalJSON() ([]byte, error)
func (*VariableDeclaration) Type ¶
func (*VariableDeclaration) Type() string
Type is the abstract type
type VariableDeclarator ¶
type VariableDeclarator struct { *BaseNode ID *Identifier `json:"id"` Init Expression `json:"init"` }
VariableDeclarator represents the declaration of a variable
func (*VariableDeclarator) Copy ¶ added in v0.0.4
func (d *VariableDeclarator) Copy() Node
func (*VariableDeclarator) MarshalJSON ¶ added in v0.0.4
func (d *VariableDeclarator) MarshalJSON() ([]byte, error)
func (*VariableDeclarator) Type ¶
func (*VariableDeclarator) Type() string
Type is the abstract type
func (*VariableDeclarator) UnmarshalJSON ¶ added in v0.0.4
func (d *VariableDeclarator) UnmarshalJSON(data []byte) error