compiler

package
v0.0.0-...-841437a Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const Key = "Compiler"
View Source
const SchemaPackerKey = "SchemaPacker"

Variables

This section is empty.

Functions

func ToSchemaName

func ToSchemaName(fp string) string

Converts the Schema's filepath into its corresponding name.

Types

type CompileAllOptions

type CompileAllOptions struct {
	CompileOptions
	Force bool
}

type CompileOptions

type CompileOptions struct {
	ParseOptions
	// The directory that the file will be output to. If the directory does not exist, it will be created.
	OutputDirectory string `validate:"required_without=DryRun"`
	DryRun          bool
	Type            string `validate:"omitempty,oneof=json toml yaml yml"`
}

type Compiler

type Compiler interface {
	Compile(filepath string, options CompileOptions) (*domain.CompiledSchema, error)
	CompileAll(path string, options CompileAllOptions) (SchemaPack, error)
	ValidateSemantics(manifest *domain.ParsedSchema) error
	Parse(fp string, options ParseOptions) (*domain.ParsedSchema, error)
	Load(root, fp string) (*domain.Schema, error)
}

type Package

type Package struct {
}

func (*Package) Bindings

func (*Package) Bindings() []axon.Binding

type ParseOptions

type ParseOptions struct {
	// The root directory of the file to parse which determines the name of the file. The file that is being
	// parsed must lie within this directory.
	Root string `validate:"required,file"`
}

type SchemaPack

type SchemaPack interface {
	Schemas() map[string]domain.CompiledSchema
	Path() string
}

func NewSchemaPack

func NewSchemaPack(path string) SchemaPack

type SchemaPackError

type SchemaPackError struct {
	// contains filtered or unexported fields
}

func NewSchemaPackError

func NewSchemaPackError(errs ...error) *SchemaPackError

func (*SchemaPackError) AddError

func (p *SchemaPackError) AddError(e error)

func (*SchemaPackError) Error

func (p *SchemaPackError) Error() string

func (*SchemaPackError) Errors

func (p *SchemaPackError) Errors() []error

type SchemaPacker

type SchemaPacker interface {
	AddSchema(pack SchemaPack, schema *domain.CompiledSchema) error
}

Jump to

Keyboard shortcuts

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