flux

package
v2.7.11 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(lhs, rhs ast.Expression) *ast.BinaryExpression

Add returns a addition *ast.BinaryExpression.

func And

func And(lhs, rhs ast.Expression) *ast.LogicalExpression

And returns an and *ast.LogicalExpression.

func Array

func Array(es ...ast.Expression) *ast.ArrayExpression

Array returns *ast.ArrayExpression with elements es.

func Bool

func Bool(b bool) *ast.BooleanLiteral

Bool returns an *ast.BooleanLiteral of b.

func Call

Call returns a *ast.CallExpression that is a function call of fn with args.

func DefineTaskOption

func DefineTaskOption(o *ast.ObjectExpression) *ast.OptionStatement

DefineTaskOption returns an *ast.OptionStatement with the object provided. (e.g. option task = {...})

func DefineVariable

func DefineVariable(id string, e ast.Expression) *ast.VariableAssignment

DefineVariable returns an *ast.VariableAssignment of id to the e. (e.g. id = <expression>)

func Dictionary

func Dictionary(key string, v ast.Expression) *ast.Property

Dictionary returns an *ast.Property of string key to value expression.

func Duration

func Duration(m int64, u string) *ast.DurationLiteral

Duration returns an *ast.DurationLiteral for a single duration.

func Equal

func Equal(lhs, rhs ast.Expression) *ast.BinaryExpression

Equal returns an equal to *ast.BinaryExpression.

func ExpressionStatement

func ExpressionStatement(e ast.Expression) *ast.ExpressionStatement

ExpressionStatement returns an *ast.ExpressionStatement of e.

func File

func File(name string, imports []*ast.ImportDeclaration, body []ast.Statement) *ast.File

File creates a new *ast.File.

func Float

func Float(f float64) *ast.FloatLiteral

Float returns an *ast.FloatLiteral of f.

func FuncBlock

func FuncBlock(params []*ast.Property, stms ...ast.Statement) *ast.FunctionExpression

FuncBlock takes a series of statements and produces a function.

func Function

func Function(params []*ast.Property, b ast.Expression) *ast.FunctionExpression

Function returns an *ast.FunctionExpression with params with body b.

func FunctionParams

func FunctionParams(args ...string) []*ast.Property

FunctionParams returns a slice of *ast.Property for the parameters of a function.

func GreaterThan

func GreaterThan(lhs, rhs ast.Expression) *ast.BinaryExpression

GreaterThan returns a greater than *ast.BinaryExpression.

func Identifier

func Identifier(i string) *ast.Identifier

Identifier returns an *ast.Identifier of i.

func If

func If(test, consequent, alternate ast.Expression) *ast.ConditionalExpression

If returns an *ast.ConditionalExpression

func ImportDeclaration

func ImportDeclaration(pkg string) *ast.ImportDeclaration

ImportDeclaration returns an *ast.ImportDeclaration for pkg.

func Imports

func Imports(pkgs ...string) []*ast.ImportDeclaration

Imports returns a []*ast.ImportDeclaration for each package in pkgs.

func Integer

func Integer(i int64) *ast.IntegerLiteral

Integer returns an *ast.IntegerLiteral of i.

func LessThan

func LessThan(lhs, rhs ast.Expression) *ast.BinaryExpression

LessThan returns a less than *ast.BinaryExpression.

func Member

func Member(p, c string) *ast.MemberExpression

Member returns an *ast.MemberExpression where the key is p and the values is c.

func Negative

func Negative(e ast.Expression) *ast.UnaryExpression

Negative returns *ast.UnaryExpression for -(e).

func Object

func Object(ps ...*ast.Property) *ast.ObjectExpression

Object returns an *ast.ObjectExpression with properties ps.

func ObjectWith

func ObjectWith(name string, ps ...*ast.Property) *ast.ObjectExpression

ObjectWith adds many properties to an existing named identifier.

func Or

func Or(lhs, rhs ast.Expression) *ast.LogicalExpression

Or returns an or *ast.LogicalExpression.

func Pipe

func Pipe(base ast.Expression, calls ...*ast.CallExpression) *ast.PipeExpression

Pipe returns a *ast.PipeExpression that is a piped sequence of call expressions starting at base. It requires at least one call expression and will panic otherwise.

func Property

func Property(key string, e ast.Expression) *ast.Property

Property returns an *ast.Property of key to e. (e.g. key: <expression>)

func String

func String(s string) *ast.StringLiteral

String returns an *ast.StringLiteral of s.

func Subtract

func Subtract(lhs, rhs ast.Expression) *ast.BinaryExpression

Subtract returns a subtraction *ast.BinaryExpression.

Types

This section is empty.

Jump to

Keyboard shortcuts

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