plugin

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field added in v0.5.0

type Field struct {
	ParentGoType string
	Type         string
	F            *protogen.Field
	Package      string

	*gorm.GormFieldOptions
	ParentOriginName string
}

type OrmPlugin

type OrmPlugin struct {
	*protogen.Plugin
	SuppressWarnings bool
	StringEnums      bool
	Gateway          bool

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

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

func (*OrmPlugin) Fail added in v1.0.0

func (p *OrmPlugin) Fail(args ...string)

func (*OrmPlugin) Generate

func (p *OrmPlugin) Generate()

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

func (p *OrmPlugin) Init(g *protogen.Plugin)

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

func (*OrmPlugin) IsAbleToMakePQArray added in v1.0.0

func (p *OrmPlugin) IsAbleToMakePQArray(fieldType string) bool

IsAbleToMakePQArray tells us if the specific field-type can automatically be turned into a PQ array:

func (*OrmPlugin) Name

func (p *OrmPlugin) Name() string

Name identifies the plugin

func (*OrmPlugin) P added in v1.0.0

func (p *OrmPlugin) P(args ...interface{})

type OrmableLookup added in v1.0.0

type OrmableLookup map[string]*OrmableType

OrmableLookup is a helper map for tracking associations and relations between models.

func (*OrmableLookup) GetOrmableByMessage added in v1.0.0

func (o *OrmableLookup) GetOrmableByMessage(message *protogen.Message) *OrmableType

GetOrmableByMessage returns the registered ormable object given the message's typename param exists.

func (*OrmableLookup) GetOrmableByType added in v1.0.0

func (o *OrmableLookup) GetOrmableByType(typeName string) *OrmableType

GetOrmableByType returns the registered ormable object given the typename param exists.

func (*OrmableLookup) TypeOk added in v1.0.0

func (o *OrmableLookup) TypeOk(t string) bool

TypeOk returns true if the parameter type is registered as ormable.

type OrmableType added in v0.5.0

type OrmableType struct {
	OriginName string
	Name       string
	Message    *protogen.Message
	Package    string
	File       *protogen.File
	Fields     map[string]*Field

	Methods map[string]*autogenMethod
	// contains filtered or unexported fields
}

func NewOrmableType added in v0.5.0

func NewOrmableType(oname string, msg *protogen.Message, file *protogen.File) *OrmableType

Jump to

Keyboard shortcuts

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