Documentation ¶
Index ¶
- Constants
- func AddCompilerMappings(mappings flux.CompilerMappings) error
- func WalkIR(ctx context.Context, astPkg *ast.Package, f func(o *flux.Operation) error) error
- type ASTCompiler
- type AstProgram
- type CompileOption
- type ExecutionDependencies
- type FluxCompiler
- type LoggingProgram
- type Program
- type TableObjectCompiler
Constants ¶
const ( FluxCompilerType = "flux" ASTCompilerType = "ast" )
Variables ¶
This section is empty.
Functions ¶
func AddCompilerMappings ¶
func AddCompilerMappings(mappings flux.CompilerMappings) error
AddCompilerMappings adds the Flux specific compiler mappings.
Types ¶
type ASTCompiler ¶ added in v0.18.0
ASTCompiler implements Compiler by producing a Spec from an AST.
func (ASTCompiler) CompilerType ¶ added in v0.18.0
func (ASTCompiler) CompilerType() flux.CompilerType
func (*ASTCompiler) PrependFile ¶ added in v0.21.0
func (c *ASTCompiler) PrependFile(file *ast.File)
PrependFile prepends a file onto the compiler's list of package files.
type AstProgram ¶ added in v0.26.0
AstProgram wraps a Program with an AST that will be evaluated upon Start. As such, the PlanSpec is populated after Start and evaluation errors are returned by Start.
func Compile ¶ added in v0.26.0
func Compile(q string, now time.Time, opts ...CompileOption) (*AstProgram, error)
Compile evaluates a Flux script producing a flux.Program. now parameter must be non-zero, that is the default now time should be set before compiling.
func CompileAST ¶ added in v0.26.0
func CompileAST(astPkg *ast.Package, now time.Time, opts ...CompileOption) *AstProgram
CompileAST evaluates a Flux AST and produces a flux.Program. now parameter must be non-zero, that is the default now time should be set before compiling.
type CompileOption ¶ added in v0.26.0
type CompileOption func(*compileOptions)
CompileOption represents an option for compilation.
func Verbose ¶ added in v0.26.0
func Verbose(v bool) CompileOption
func WithExtern ¶ added in v0.33.0
func WithExtern(extern *ast.File) CompileOption
func WithLogPlanOpts ¶ added in v0.26.0
func WithLogPlanOpts(lopts ...plan.LogicalOption) CompileOption
func WithPhysPlanOpts ¶ added in v0.26.0
func WithPhysPlanOpts(popts ...plan.PhysicalOption) CompileOption
type ExecutionDependencies ¶ added in v0.48.0
ExecutionDependencies represents the dependencies that a function call executed by the Interpreter needs in order to trigger the execution of a flux.Program
func GetExecutionDependencies ¶ added in v0.48.0
func GetExecutionDependencies(ctx context.Context) ExecutionDependencies
type FluxCompiler ¶
type FluxCompiler struct { Now time.Time Extern *ast.File `json:"extern"` Query string `json:"query"` }
FluxCompiler compiles a Flux script into a spec.
func (FluxCompiler) CompilerType ¶
func (c FluxCompiler) CompilerType() flux.CompilerType
type LoggingProgram ¶ added in v0.48.0
type Program ¶ added in v0.26.0
type Program struct { Logger *zap.Logger PlanSpec *plan.Spec // contains filtered or unexported fields }
Program implements the flux.Program interface. It will execute a compiled plan using an executor.
func CompileTableObject ¶ added in v0.26.0
func CompileTableObject(ctx context.Context, to *flux.TableObject, now time.Time, opts ...CompileOption) (*Program, error)
CompileTableObject evaluates a TableObject and produces a flux.Program. now parameter must be non-zero, that is the default now time should be set before compiling.
type TableObjectCompiler ¶ added in v0.26.0
type TableObjectCompiler struct { Tables *flux.TableObject Now time.Time }
TableObjectCompiler compiles a TableObject into an executable flux.Program. It is not added to CompilerMappings and it is not serializable, because it is impossible to use it outside of the context of an ongoing execution.
func (*TableObjectCompiler) CompilerType ¶ added in v0.26.0
func (*TableObjectCompiler) CompilerType() flux.CompilerType