Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectorGenerator ¶
type ConnectorGenerator struct {
*base.Generator
Config *config.Config
Models []*ModelGenerator
Data *ConnectorGeneratorData
}
ConnectorGenerator manages generation of the database connector
func NewConnectorGenerator ¶
func NewConnectorGenerator(cfg *config.Config, models []*ModelGenerator) *ConnectorGenerator
NewConnectorGenerator creates and returns a ConnectorGenerator
func (*ConnectorGenerator) Execute ¶
func (g *ConnectorGenerator) Execute() error
Execute configures and generates the database connector
type ConnectorGeneratorData ¶
type ConnectorGeneratorData struct {
Package string
Models []*ConnectorGeneratorDataModel
Repo string
}
ConnectorGeneratorData stores the data for the database connector template
type ConnectorGeneratorDataModel ¶ added in v0.7.0
type Field ¶
type Field struct {
Name string
Camel string
Type string
Json string
Bson string
Tags string
Fields []*Field
}
Field holds the data from the YAML field
type FieldGenerator ¶
type FieldGenerator struct {
Definition *Field
// contains filtered or unexported fields
}
FieldGenerator is the generator of model fields
func (*FieldGenerator) Execute ¶
func (f *FieldGenerator) Execute(s *bytes.Buffer) error
Execute generates the field using the template
func (*FieldGenerator) Prepare ¶
func (f *FieldGenerator) Prepare() error
Prepare configures the data for the template
type Generator ¶
type Generator struct {
Config *config.Config
Models []*ModelGenerator
}
Generator manages the generation of all database related files
type Model ¶
type Model struct {
Package string
Camel string
Name string
Type string
Imports []string
Fields []*Field
}
Model holds the data from the YAML model
type ModelGenerator ¶
type ModelGenerator struct {
*base.Generator
Config *config.Config
Name string
Path string
Definition *Model
// contains filtered or unexported fields
}
ModelGenerator is the database model generator
func NewModelGenerator ¶
func NewModelGenerator(cfg *config.Config, name, path string) (*ModelGenerator, error)
NewModelGenerator creates and returns an instance of ModelGenerator
func (*ModelGenerator) Execute ¶
func (m *ModelGenerator) Execute() error
Execute generates the model file from the template