Documentation ¶
Index ¶
- Constants
- Variables
- func CleanImports(pFileText *string) *string
- type Field
- type OrmPlugin
- func (p *OrmPlugin) CleanFiles(response *plugin.CodeGeneratorResponse)
- func (p *OrmPlugin) Generate(file *generator.FileDescriptor)
- func (p *OrmPlugin) GenerateImports(file *generator.FileDescriptor)
- func (p *OrmPlugin) GetFileImports() *fileImports
- func (p *OrmPlugin) Import(packagePath string) string
- func (p *OrmPlugin) Init(g *generator.Generator)
- func (p *OrmPlugin) Name() string
- func (p *OrmPlugin) UsingGoImports(pkgNames ...string)
- type OrmableType
Constants ¶
const ( ENGINE_UNSET = iota ENGINE_POSTGRES )
DB Engine Enum
Variables ¶
var AtlasAppToolkitVersion string
var ProtocGenGormVersion string
Functions ¶
func CleanImports ¶
CleanImports removes extraneous imports and lines from a proto response file Content
Types ¶
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
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 ¶
Init is called once after data structures are built but before code generation begins.
func (*OrmPlugin) UsingGoImports ¶ added in v0.6.0
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