lang

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: MIT Imports: 4 Imported by: 28

Documentation

Index

Constants

View Source
const (
	FluxCompilerType = "flux"
	SpecCompilerType = "spec"
	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

type ASTCompiler struct {
	AST *ast.Package `json:"ast"`
	Now time.Time
}

ASTCompiler implements Compiler by producing a Spec from an AST.

func (ASTCompiler) Compile added in v0.18.0

func (c ASTCompiler) Compile(ctx context.Context) (*flux.Spec, error)

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 FluxCompiler

type FluxCompiler struct {
	Query string `json:"query"`
}

FluxCompiler compiles a Flux script into a spec.

func (FluxCompiler) Compile

func (c FluxCompiler) Compile(ctx context.Context) (*flux.Spec, error)

func (FluxCompiler) CompilerType

func (c FluxCompiler) CompilerType() flux.CompilerType

type SpecCompiler

type SpecCompiler struct {
	Spec *flux.Spec `json:"spec"`
}

SpecCompiler implements Compiler by returning a known spec.

func (SpecCompiler) Compile

func (c SpecCompiler) Compile(ctx context.Context) (*flux.Spec, error)

func (SpecCompiler) CompilerType

func (c SpecCompiler) CompilerType() flux.CompilerType

Jump to

Keyboard shortcuts

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