tick

package
v1.5.1-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func At

func At(left, right ast.Node) ast.Node

At produces an At ast.ChainNode

func Dot

func Dot(left, right ast.Node) ast.Node

Dot produces a Defense of the ancients.ChainNode

func Func

func Func(name string, args ...interface{}) (ast.Node, error)

Func produces an ast.FunctionNode. Can return a nil Node if all function arguments evaluate to the zero value.

func FuncRemoveZero added in v1.5.0

func FuncRemoveZero(name string, args ...interface{}) (ast.Node, error)

FuncRemoveZero produces an ast.FunctionNode. All function arguments that evaluate to the zero value are removed from func.

func FuncWithZero

func FuncWithZero(name string, args ...interface{}) (ast.Node, error)

FuncWithZero produces an ast.FunctionNode. All function arguments that evaluate to the zero value are kept.

func IsZero

func IsZero(arg interface{}) bool

IsZero check if the argument is the tickscript zero value for that type.

func Literal

func Literal(lit interface{}) (ast.Node, error)

Literal produces an ast Literal (NumberNode, etc).

func Pipe

func Pipe(left, right ast.Node) ast.Node

Pipe produces a Pipe ast.ChainNode

Types

type AST

type AST struct {
	Program ast.ProgramNode
	// contains filtered or unexported fields
}

AST converts a pipeline into an AST

func (*AST) Build

func (a *AST) Build(p *pipeline.Pipeline) error

Build constructs the AST Program node from the pipeline

func (*AST) Create

func (a *AST) Create(n pipeline.Node, parents []ast.Node) (ast.Node, error)

Create converts a pipeline Node to a function

func (a *AST) Link(node pipeline.Node, function ast.Node)

Link inspects the pipeline node to determine if it should become a variable, or, be considered "complete."

func (*AST) Variable

func (a *AST) Variable(ident string, right ast.Node) *AST

Variable produces an ast.DeclarationNode using ident as the identifier name.

type AlertNode

type AlertNode struct {
	Function
}

AlertNode converts the Alert pipeline node into the TICKScript AST

func NewAlert

func NewAlert(parents []ast.Node) *AlertNode

NewAlert creates an Alert function builder

func (*AlertNode) Build

func (n *AlertNode) Build(a *pipeline.AlertNode) (ast.Node, error)

Build creates a Alert ast.Node

type BarrierNode

type BarrierNode struct {
	Function
}

BarrierNode converts the window pipeline node into the TICKScript AST

func NewBarrierNode

func NewBarrierNode(parents []ast.Node) *BarrierNode

NewBarrierNode creates a Barrier function builder

func (*BarrierNode) Build

func (n *BarrierNode) Build(b *pipeline.BarrierNode) (ast.Node, error)

Build creates a window ast.Node

type BatchNode

type BatchNode struct{}

BatchNode converts the batch pipeline node into the TICKScript AST

func (*BatchNode) Build

func (b *BatchNode) Build() (ast.Node, error)

Build batch ast.Node

type ChangeDetectNode added in v1.5.0

type ChangeDetectNode struct {
	Function
}

ChangeDetectNode converts the ChangeDetect pipeline node into the TICKScript AST

func NewChangeDetect added in v1.5.0

func NewChangeDetect(parents []ast.Node) *ChangeDetectNode

NewChangeDetect creates a ChangeDetect function builder

func (*ChangeDetectNode) Build added in v1.5.0

Build creates a ChangeDetect ast.Node

type CombineNode

type CombineNode struct {
	Function
}

CombineNode converts the Combine pipeline node into the TICKScript AST

func NewCombine

func NewCombine(parents []ast.Node) *CombineNode

NewCombine creates a Combine function builder

func (*CombineNode) Build

func (n *CombineNode) Build(c *pipeline.CombineNode) (ast.Node, error)

Build creates a Combine ast.Node

type DefaultNode

type DefaultNode struct {
	Function
}

DefaultNode converts the Default pipeline node into the TICKScript AST

func NewDefault

func NewDefault(parents []ast.Node) *DefaultNode

NewDefault creates a Default function builder

func (*DefaultNode) Build

func (n *DefaultNode) Build(d *pipeline.DefaultNode) (ast.Node, error)

Build creates a Default ast.Node

type DeleteNode

type DeleteNode struct {
	Function
}

DeleteNode converts the Delete pipeline node into the TICKScript AST

func NewDelete

func NewDelete(parents []ast.Node) *DeleteNode

NewDelete creates a Delete function builder

func (*DeleteNode) Build

func (n *DeleteNode) Build(d *pipeline.DeleteNode) (ast.Node, error)

Build creates a Delete ast.Node

type DerivativeNode

type DerivativeNode struct {
	Function
}

DerivativeNode converts the Derivative pipeline node into the TICKScript AST

func NewDerivative

func NewDerivative(parents []ast.Node) *DerivativeNode

NewDerivative creates a Derivative function builder

func (*DerivativeNode) Build

Build creates a Derivative ast.Node

type Ec2AutoscaleNode

type Ec2AutoscaleNode struct {
	Function
}

Ec2AutoscaleNode converts the ec2 autoscaling pipeline node into the TICKScript AST

func NewEc2Autoscale

func NewEc2Autoscale(parents []ast.Node) *Ec2AutoscaleNode

NewEc2Autoscale creates a Ec2Autoscale function builder

func (*Ec2AutoscaleNode) Build

Build creates a Ec2Autoscale ast.Node

type EvalNode

type EvalNode struct {
	Function
}

EvalNode converts the EvalNode pipeline node into the TICKScript AST

func NewEval

func NewEval(parents []ast.Node) *EvalNode

NewEval creates a EvalNode function builder

func (*EvalNode) Build

func (n *EvalNode) Build(e *pipeline.EvalNode) (ast.Node, error)

Build creates a Eval ast.Node

type FlattenNode

type FlattenNode struct {
	Function
}

FlattenNode converts the FlattenNode pipeline node into the TICKScript AST

func NewFlatten

func NewFlatten(parents []ast.Node) *FlattenNode

NewFlatten creates a FlattenNode function builder

func (*FlattenNode) Build

func (n *FlattenNode) Build(f *pipeline.FlattenNode) (ast.Node, error)

Build creates a Flatten ast.Node

type FromNode

type FromNode struct {
	Function
}

FromNode converts the FromNode pipeline node into the TICKScript AST

func NewFrom

func NewFrom(parents []ast.Node) *FromNode

NewFrom creates a FromNode function builder

func (*FromNode) Build

func (n *FromNode) Build(f *pipeline.FromNode) (ast.Node, error)

Build creates a from ast.Node

type Function

type Function struct {
	Parents []ast.Node
	// contains filtered or unexported fields
}

Function builds functions from pipeline nodes

func (*Function) At

func (f *Function) At(name string, args ...interface{}) *Function

At produces an ast.FunctionNode within an At Chain. May return the parent node if all args evaluate to the zero value. Assumes there is only one At called per Function. Assumes one parent exists.

func (*Function) Dot

func (f *Function) Dot(name string, args ...interface{}) *Function

Dot produces an ast.FunctionNode within a Dot Chain. May return a parent node if all args evaluate to the zero value Assumes a previous node has been created.

func (*Function) DotIf

func (f *Function) DotIf(name string, use bool) *Function

DotIf produces an ast.FunctionNode within a Dot Chain if use is true Assumes a previous node has been created.

func (*Function) DotNotEmpty

func (f *Function) DotNotEmpty(name string, arg ...interface{}) *Function

DotNotEmpty produces an ast.FunctionNode within a Dot Chain if the argument list is not empty. Assumes a previous node has been created.

func (*Function) DotNotNil

func (f *Function) DotNotNil(name string, arg interface{}) *Function

DotNotNil produces an ast.FunctionNode within a Dot Chain if arg is not nil. Assumes a previous node has been created.

func (*Function) DotRemoveZeroValue added in v1.5.0

func (f *Function) DotRemoveZeroValue(name string, args ...interface{}) *Function

DotRemoveZeroValue produces an ast.FunctionNode within a Dot Chain. Assumes a previous node has been created. Remove all zero argument values from func.

func (*Function) DotZeroValueOK

func (f *Function) DotZeroValueOK(name string, args ...interface{}) *Function

DotZeroValueOK produces an ast.FunctionNode within a Dot Chain. Assumes a previous node has been created.

func (*Function) Pipe

func (f *Function) Pipe(name string, args ...interface{}) *Function

Pipe produces an ast.FunctionNode within a Pipe Chain. May return the parent node if all args evaluate to the zero value. Assumes there is only one Pipe called per Function. Assumes one parent exists.

type GroupByNode

type GroupByNode struct {
	Function
}

GroupByNode converts the GroupByNode pipeline node into the TICKScript AST

func NewGroupBy

func NewGroupBy(parents []ast.Node) *GroupByNode

NewGroupBy creates a GroupByNode function builder

func (*GroupByNode) Build

func (n *GroupByNode) Build(g *pipeline.GroupByNode) (ast.Node, error)

Build creates a GroupByNode ast.Node

type HTTPOutNode

type HTTPOutNode struct {
	Function
}

HTTPOutNode converts the HTTPOutNode pipeline node into the TICKScript AST

func NewHTTPOut

func NewHTTPOut(parents []ast.Node) *HTTPOutNode

NewHTTPOut creates a HTTPOutNode function builder

func (*HTTPOutNode) Build

func (n *HTTPOutNode) Build(h *pipeline.HTTPOutNode) (ast.Node, error)

Build creates a HTTPOutNode ast.Node

type HTTPPostNode

type HTTPPostNode struct {
	Function
}

HTTPPostNode converts the HTTPPostNode pipeline node into the TICKScript AST

func NewHTTPPost

func NewHTTPPost(parents []ast.Node) *HTTPPostNode

NewHTTPPost creates a HTTPPostNode function builder

func (*HTTPPostNode) Build

func (n *HTTPPostNode) Build(h *pipeline.HTTPPostNode) (ast.Node, error)

Build creates a HTTPPostNode ast.Node

type InfluxDBOutNode

type InfluxDBOutNode struct {
	Function
}

InfluxDBOutNode converts the InfluxDBOutNode pipeline node into the TICKScript AST

func NewInfluxDBOut

func NewInfluxDBOut(parents []ast.Node) *InfluxDBOutNode

NewInfluxDBOut creates a InfluxQL function builder

func (*InfluxDBOutNode) Build

Build creates a InfluxDBOutNode ast.Node

type InfluxQLNode

type InfluxQLNode struct {
	Function
}

InfluxQLNode converts the InfluxQLNode pipeline node into the TICKScript AST

func NewInfluxQL

func NewInfluxQL(parents []ast.Node) *InfluxQLNode

NewInfluxQL creates a InfluxQLNode function builder

func (*InfluxQLNode) Build

func (n *InfluxQLNode) Build(q *pipeline.InfluxQLNode) (ast.Node, error)

Build creates a InfluxQLNode ast.Node

type JoinNode

type JoinNode struct {
	Function
}

JoinNode converts the JoinNode pipeline node into the TICKScript AST

func NewJoin

func NewJoin(parents []ast.Node) *JoinNode

NewJoin creates a JoinNode function builder

func (*JoinNode) Build

func (n *JoinNode) Build(j *pipeline.JoinNode) (ast.Node, error)

Build creates a JoinNode ast.Node

type K8sAutoscaleNode

type K8sAutoscaleNode struct {
	Function
}

K8sAutoscaleNode converts the K8sAutoscaleNode pipeline node into the TICKScript AST

func NewK8sAutoscale

func NewK8sAutoscale(parents []ast.Node) *K8sAutoscaleNode

NewK8sAutoscale creates a K8sAutoscaleNode function builder

func (*K8sAutoscaleNode) Build

Build creates a K8sAutoscaleNode ast.Node

type KapacitorLoopbackNode

type KapacitorLoopbackNode struct {
	Function
}

KapacitorLoopbackNode converts the KapacitorLoopbackNode pipeline node into the TICKScript AST

func NewKapacitorLoopbackNode

func NewKapacitorLoopbackNode(parents []ast.Node) *KapacitorLoopbackNode

NewKapacitorLoopbackNode creates a KapacitorLoopbackNode function builder

func (*KapacitorLoopbackNode) Build

Build creates a KapacitorLoopbackNode ast.Node

type LogNode

type LogNode struct {
	Function
}

LogNode converts the LogNode pipeline node into the TICKScript AST

func NewLog

func NewLog(parents []ast.Node) *LogNode

NewLog creates a LogNode function builder

func (*LogNode) Build

func (n *LogNode) Build(l *pipeline.LogNode) (ast.Node, error)

Build creates a LogNode ast.Node

type NullPosition

type NullPosition struct{}

NullPosition is a NOOP to satisfy the tick AST package

func (*NullPosition) Char

func (n *NullPosition) Char() int

Char returns 0

func (*NullPosition) Line

func (n *NullPosition) Line() int

Line returns 0

func (*NullPosition) Position

func (n *NullPosition) Position() int

Position returns 0

type QueryNode

type QueryNode struct {
	Function
}

QueryNode converts the QueryNode pipeline node into the TICKScript AST

func NewQuery

func NewQuery(parents []ast.Node) *QueryNode

NewQuery creates a QueryNode function builder

func (*QueryNode) Build

func (n *QueryNode) Build(q *pipeline.QueryNode) (ast.Node, error)

Build creates a QueryNode ast.Node

type SampleNode

type SampleNode struct {
	Function
}

SampleNode converts the SampleNode pipeline node into the TICKScript AST

func NewSample

func NewSample(parents []ast.Node) *SampleNode

NewSample creates a SampleNode function builder

func (*SampleNode) Build

func (n *SampleNode) Build(s *pipeline.SampleNode) (ast.Node, error)

Build creates a SampleNode ast.Node

type ShiftNode

type ShiftNode struct {
	Function
}

ShiftNode converts the ShiftNode pipeline node into the TICKScript AST

func NewShift

func NewShift(parents []ast.Node) *ShiftNode

NewShift creates a ShiftNode function builder

func (*ShiftNode) Build

func (n *ShiftNode) Build(s *pipeline.ShiftNode) (ast.Node, error)

Build creates a ShiftNode ast.Node

type SideloadNode

type SideloadNode struct {
	Function
}

SideloadNode converts the Sideload pipeline node into the TICKScript AST

func NewSideload

func NewSideload(parents []ast.Node) *SideloadNode

NewSideload creates a Sideload function builder

func (*SideloadNode) Build

func (n *SideloadNode) Build(d *pipeline.SideloadNode) (ast.Node, error)

Build creates a Sideload ast.Node

type StateCountNode

type StateCountNode struct {
	Function
}

StateCountNode converts the StateCountNode pipeline node into the TICKScript AST

func NewStateCount

func NewStateCount(parents []ast.Node) *StateCountNode

NewStateCount creates a StateCountNode function builder

func (*StateCountNode) Build

Build creates a StateCountNode ast.Node

type StateDurationNode

type StateDurationNode struct {
	Function
}

StateDurationNode converts the StateDurationNode pipeline node into the TICKScript AST

func NewStateDuration

func NewStateDuration(parents []ast.Node) *StateDurationNode

NewStateDuration creates a StateDurationNode function builder

func (*StateDurationNode) Build

Build creates a StateDurationNode ast.Node

type StatsNode

type StatsNode struct {
	Function
}

StatsNode converts the StatsNode pipeline node into the TICKScript AST

func NewStats

func NewStats(parents []ast.Node) *StatsNode

NewStats creates a StatsNode function builder

func (*StatsNode) Build

func (n *StatsNode) Build(s *pipeline.StatsNode) (ast.Node, error)

Build StatsNode ast.Node

type StreamNode

type StreamNode struct{}

StreamNode converts the stream pipeline node into the TICKScript AST

func (*StreamNode) Build

func (s *StreamNode) Build() (ast.Node, error)

Build stream ast.Node

type SwarmAutoscaleNode

type SwarmAutoscaleNode struct {
	Function
}

SwarmAutoscaleNode converts the swarm autoscaling pipeline node into the TICKScript AST

func NewSwarmAutoscale

func NewSwarmAutoscale(parents []ast.Node) *SwarmAutoscaleNode

NewSwarmAutoscale creates a SwarmAutoscale function builder

func (*SwarmAutoscaleNode) Build

Build creates a SwarmAutoscale ast.Node

type UDFNode

type UDFNode struct {
	Function
}

UDFNode converts the UDF pipeline node into the TICKScript AST

func NewUDF

func NewUDF(parents []ast.Node) *UDFNode

NewUDF creates a UDF function builder

func (*UDFNode) Build

func (n *UDFNode) Build(u *pipeline.UDFNode) (ast.Node, error)

Build creates a UDF ast.Node

type UnionNode

type UnionNode struct {
	Function
}

UnionNode converts the union pipeline node into the TICKScript AST

func NewUnion

func NewUnion(parents []ast.Node) *UnionNode

NewUnion creates a Union function builder

func (*UnionNode) Build

func (n *UnionNode) Build(u *pipeline.UnionNode) (ast.Node, error)

Build creates a union ast.Node

type WhereNode

type WhereNode struct {
	Function
}

WhereNode converts the where pipeline node into the TICKScript AST

func NewWhere

func NewWhere(parents []ast.Node) *WhereNode

NewWhere creates a Where function builder

func (*WhereNode) Build

func (n *WhereNode) Build(w *pipeline.WhereNode) (ast.Node, error)

Build creates a where ast.Node

type WindowNode

type WindowNode struct {
	Function
}

WindowNode converts the window pipeline node into the TICKScript AST

func NewWindowNode

func NewWindowNode(parents []ast.Node) *WindowNode

NewWindowNode creates a Window function builder

func (*WindowNode) Build

func (n *WindowNode) Build(w *pipeline.WindowNode) (ast.Node, error)

Build creates a window ast.Node

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL