plugin

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENGINE_UNSET = iota
	ENGINE_POSTGRES
)

DB Engine Enum

Variables

View Source
var AtlasAppToolkitVersion string
View Source
var ProtocGenGormVersion string

Functions

func CleanImports

func CleanImports(pFileText *string) *string

CleanImports removes extraneous imports and lines from a proto response file Content

Types

type Field added in v0.5.0

type Field struct {
	ParentGoType string
	Type         string
	Package      string
	*gorm.GormFieldOptions
	ParentOriginName string
}

type OrmPlugin

type OrmPlugin struct {
	*generator.Generator

	EmptyFiles []string
	// contains filtered or unexported fields
}

OrmPlugin implements the plugin interface and creates GORM code from .protos

func (*OrmPlugin) CleanFiles added in v0.5.0

func (p *OrmPlugin) CleanFiles(response *plugin.CodeGeneratorResponse)

CleanFiles will prevent generation of any files where no real code is generated

func (*OrmPlugin) Generate

func (p *OrmPlugin) Generate(file *generator.FileDescriptor)

Generate produces the code generated by the plugin for this file, except for the imports, by calling the generator's methods P, In, and Out.

func (*OrmPlugin) GenerateImports

func (p *OrmPlugin) GenerateImports(file *generator.FileDescriptor)

GenerateImports writes out required imports for the generated files

func (*OrmPlugin) GetFileImports added in v0.6.0

func (p *OrmPlugin) GetFileImports() *fileImports

func (*OrmPlugin) Import added in v0.6.0

func (p *OrmPlugin) Import(packagePath string) string

Import takes a package and adds it to the list of packages to import It will generate a unique new alias using the last portion of the import path unless the package is already imported for this file. Either way, it returns the package alias

func (*OrmPlugin) Init

func (p *OrmPlugin) Init(g *generator.Generator)

Init is called once after data structures are built but before code generation begins.

func (*OrmPlugin) Name

func (p *OrmPlugin) Name() string

Name identifies the plugin

func (*OrmPlugin) UsingGoImports added in v0.6.0

func (p *OrmPlugin) UsingGoImports(pkgNames ...string)

UsingGoImports should be used with basic packages like "time", or "context"

type OrmableType added in v0.5.0

type OrmableType struct {
	OriginName string
	Name       string
	Package    string
	File       *generator.FileDescriptor
	Fields     map[string]*Field
	Methods    map[string]*autogenMethod
}

func NewOrmableType added in v0.5.0

func NewOrmableType(oname, pkg string, file *generator.FileDescriptor) *OrmableType

Jump to

Keyboard shortcuts

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