lang

package
v0.85.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 21 Imported by: 28

Documentation

Index

Constants

View Source
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 added in v0.68.0

func IsNonNullJSON(bs json.RawMessage) bool

Types

type ASTCompiler added in v0.18.0

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) Compile added in v0.18.0

func (c ASTCompiler) Compile(ctx context.Context, runtime flux.Runtime) (flux.Program, error)

func (ASTCompiler) CompilerType added in v0.18.0

func (ASTCompiler) CompilerType() flux.CompilerType

type AstProgram added in v0.26.0

type AstProgram struct {
	*Program

	Ast flux.ASTHandle
	Now time.Time
}

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, 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 added in v0.26.0

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.

func (*AstProgram) GetAst added in v0.71.0

func (p *AstProgram) GetAst() (flux.ASTHandle, error)

Prepare the Ast for semantic analysis

func (*AstProgram) Start added in v0.26.0

func (p *AstProgram) Start(ctx context.Context, alloc *memory.Allocator) (flux.Query, error)

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 flux.ASTHandle) 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 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) Compile

func (c FluxCompiler) Compile(ctx context.Context, runtime flux.Runtime) (flux.Program, error)

func (FluxCompiler) CompilerType

func (c FluxCompiler) CompilerType() flux.CompilerType

type LoggingProgram added in v0.48.0

type LoggingProgram interface {
	SetLogger(logger *zap.Logger)
}

type Program added in v0.26.0

type Program struct {
	Logger   *zap.Logger
	PlanSpec *plan.Spec
	Runtime  flux.Runtime

	Profilers []execute.Profiler
	// 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.

func (*Program) SetLogger added in v0.26.0

func (p *Program) SetLogger(logger *zap.Logger)

func (*Program) Start added in v0.26.0

func (p *Program) Start(ctx context.Context, alloc *memory.Allocator) (flux.Query, error)

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) Compile added in v0.26.0

func (c *TableObjectCompiler) Compile(ctx context.Context) (flux.Program, error)

func (*TableObjectCompiler) CompilerType added in v0.26.0

func (*TableObjectCompiler) CompilerType() flux.CompilerType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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