Documentation ¶
Index ¶
- Variables
- type Method
- type ModelGenerator
- func (g *ModelGenerator) CollectionInitializer() *input.Collections
- func (g *ModelGenerator) CollectionInput(packageName string, isModelImported bool, modelName string) (*input.CollectionInput, error)
- func (g *ModelGenerator) Collections(packageName string, isModelImported bool) (collections []*input.CollectionInput)
- func (g *ModelGenerator) ExtractPackages() error
- func (g *ModelGenerator) HasCollectionInitializer() bool
- func (g *ModelGenerator) Models() (models []*input.Model)
- func (g *ModelGenerator) ParsePackages(patterns ...string)
- func (g *ModelGenerator) ResolveRelationSelectors()
Constants ¶
This section is empty.
Variables ¶
var ErrModelAlreadyFound = errors.New("model already found")
Functions ¶
This section is empty.
Types ¶
type Method ¶
type Method struct { Pointer bool Name string ParameterTypes []string ReturnTypes []string ReturnStatement string }
Method is the structure that defines model methods.
func (*Method) IsNeuronCollectionName ¶
IsNeuronCollectionName checks if the method is for neuron collection name.
type ModelGenerator ¶
type ModelGenerator struct { Tags []string Types []string Exclude []string // contains filtered or unexported fields }
ModelGenerator is the neuron model generator.
func NewModelGenerator ¶
func NewModelGenerator(namingConvention string, types, tags, exclude []string) *ModelGenerator
NewModelGenerator creates new model generator.
func (*ModelGenerator) CollectionInitializer ¶
func (g *ModelGenerator) CollectionInitializer() *input.Collections
CollectionInitializer gets collection initializer.
func (*ModelGenerator) CollectionInput ¶
func (g *ModelGenerator) CollectionInput(packageName string, isModelImported bool, modelName string) (*input.CollectionInput, error)
CollectionInput creates collection input for provided model.
func (*ModelGenerator) Collections ¶
func (g *ModelGenerator) Collections(packageName string, isModelImported bool) (collections []*input.CollectionInput)
Collections return generator collections.
func (*ModelGenerator) ExtractPackages ¶
func (g *ModelGenerator) ExtractPackages() error
ExtractPackages extracts all models for provided in the packages.
func (*ModelGenerator) HasCollectionInitializer ¶
func (g *ModelGenerator) HasCollectionInitializer() bool
HasCollectionInitializer checks if the package contains collection initializer.
func (*ModelGenerator) Models ¶
func (g *ModelGenerator) Models() (models []*input.Model)
Models returns generator models.
func (*ModelGenerator) ParsePackages ¶
func (g *ModelGenerator) ParsePackages(patterns ...string)
ParsePackages analyzes the single package constructed from the patterns and Tags. ParsePackages exits if there is an error.
func (*ModelGenerator) ResolveRelationSelectors ¶
func (g *ModelGenerator) ResolveRelationSelectors()