Documentation
¶
Index ¶
Constants ¶
View Source
const Key = "Compiler"
View Source
const SchemaPackerKey = "SchemaPacker"
Variables ¶
This section is empty.
Functions ¶
func ToSchemaName ¶
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 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
}
Click to show internal directories.
Click to hide internal directories.