Documentation ¶
Index ¶
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.
func IsNonNullJSON ¶
func IsNonNullJSON(bs json.RawMessage) bool
Types ¶
type ASTCompiler ¶
type ASTCompiler struct { Extern json.RawMessage `json:"extern,omitempty"` AST json.RawMessage `json:"ast"` Now time.Time }
ASTCompiler implements Compiler by producing a Program from an AST.
func (ASTCompiler) CompilerType ¶
func (ASTCompiler) CompilerType() flux.CompilerType
type AstProgram ¶
type AstProgram struct { *Program Ast flux.ASTHandle Now time.Time // A list of profilers that are profiling this query Profilers []execute.Profiler // contains filtered or unexported fields }
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 ¶
func Compile(q string, runtime flux.Runtime, 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 ¶
func CompileAST(astPkg flux.ASTHandle, runtime flux.Runtime, now time.Time, opts ...CompileOption) *AstProgram
CompileAST evaluates a Flux handle to an 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 ¶
type CompileOption func(*compileOptions)
CompileOption represents an option for compilation.
func Verbose ¶
func Verbose(v bool) CompileOption
func WithExtern ¶
func WithExtern(extern flux.ASTHandle) CompileOption
func WithLogPlanOpts ¶
func WithLogPlanOpts(lopts ...plan.LogicalOption) CompileOption
func WithPhysPlanOpts ¶
func WithPhysPlanOpts(popts ...plan.PhysicalOption) CompileOption
type ExecOptsConfig ¶
type ExecOptsConfig struct { }
The ExecOptsConfig structure implements the interpreter.ExecOptsConfig interface, which the interpreter uses to configure options relevant to the execution engine. The interpreter is able to invoke the execution engine via tableFind and others, and therefore must be able to install these options into the execution dependency state. We use an interface to break the import cycle implied by accessing the execution module from the interpreter.
func (*ExecOptsConfig) ConfigureNow ¶
func (eoc *ExecOptsConfig) ConfigureNow(ctx context.Context, now time.Time)
func (*ExecOptsConfig) ConfigureProfiler ¶
func (eoc *ExecOptsConfig) ConfigureProfiler(ctx context.Context, profilerNames []string)
type FluxCompiler ¶
type FluxCompiler struct { Now time.Time Extern json.RawMessage `json:"extern,omitempty"` Query string `json:"query"` }
FluxCompiler compiles a Flux script into a spec.
func (FluxCompiler) CompilerType ¶
func (c FluxCompiler) CompilerType() flux.CompilerType
type LoggingProgram ¶
type Program ¶
type Program struct { Logger *zap.Logger PlanSpec *plan.Spec Runtime flux.Runtime // contains filtered or unexported fields }
Program implements the flux.Program interface. It will execute a compiled plan using an executor.
func CompileTableObject ¶
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 ¶
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 ¶
func (*TableObjectCompiler) CompilerType() flux.CompilerType