generators

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptModel

func AdaptModel(models ast.ModelMap, definitions Definitions) ast.ModelMap

Types

type Definitions

type Definitions struct {
	Types   map[string]string `json:"types"`
	Helpers map[string]string `json:"helpers"`
}

type DefinitionsMap

type DefinitionsMap map[string]struct {
	Types   map[string]string `json:"types"`
	Helpers map[string]string `json:"helpers"`
}

type GenerateConfig

type GenerateConfig struct {
	Name     string `json:"name" yaml:"name"`
	Template string `json:"template,omitempty" yaml:"template,omitempty"`
	Output   string `json:"output" yaml:"output"`
	Ignore   string `json:"ignore" yaml:"ignore"`

	From    string            `json:"from" yaml:"from"`
	Types   map[string]string `json:"types" yaml:"types"`
	Helpers map[string]string `json:"helpers" yaml:"helpers"`
}

func (GenerateConfig) ApplyDefinitions

func (g GenerateConfig) ApplyDefinitions(definitions DefinitionsMap) GenerateConfig

type OutputFile

type OutputFile struct {
	Filename string
	Body     string
}

func Generate

func Generate(root *ast.RootNode, config GenerateConfig, verbose bool) ([]OutputFile, error)

type TemplateContext added in v1.1.2

type TemplateContext struct {
	Root  *ast.RootNode
	Model *ast.Model
}

type TypesMap

type TypesMap map[string]string

Jump to

Keyboard shortcuts

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