ast

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (m *Method) IsNeuronCollectionName() bool

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()

Jump to

Keyboard shortcuts

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