plugin

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ENGINE_UNSET = iota
	ENGINE_POSTGRES
)

DB Engine Enum

Variables

View Source
var (
	ErrNotOrmable = errors.New("type is not ormable")
)

Functions

func NewFieldPath added in v1.1.3

func NewFieldPath(part string) *fieldPath

func SetSupportedFeaturesOnCodeGeneratorResponse added in v1.1.3

func SetSupportedFeaturesOnCodeGeneratorResponse(resp *pluginpb.CodeGeneratorResponse)

SetSupportedFeaturesOnCodeGeneratorResponse sets supported proto3 features on pluginpb.CodeGeneratorResponse.

func SetSupportedFeaturesOnPluginGen added in v1.1.3

func SetSupportedFeaturesOnPluginGen(gen *protogen.Plugin)

SetSupportedFeaturesOnPluginGen sets supported proto3 features on protogen.Plugin.

Types

type Field added in v0.5.0

type Field struct {
	*gormopts.GormFieldOptions
	ParentGoType         string
	TypeName             string
	Type                 *OrmableType
	Package              string
	ParentOrigName       string
	FieldAssociationInfo fieldAssociationInfo
}

type ORMBuilder added in v1.0.0

type ORMBuilder struct {
	// contains filtered or unexported fields
}

func New added in v1.0.0

func (*ORMBuilder) Generate added in v1.0.0

func (b *ORMBuilder) Generate() (*pluginpb.CodeGeneratorResponse, error)

func (*ORMBuilder) IsAbleToMakePQArray added in v1.0.0

func (b *ORMBuilder) IsAbleToMakePQArray(fieldType string) bool

func (*ORMBuilder) IsIDFieldOptional added in v1.1.3

func (b *ORMBuilder) IsIDFieldOptional(message *protogen.Message) bool

IsIDFieldOptional if the ID is an optional field

type OrmableType added in v0.5.0

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

func GetOrmable added in v0.21.0

func GetOrmable(ormableTypes map[string]*OrmableType, typeName string) (*OrmableType, error)

func NewOrmableType added in v0.5.0

func NewOrmableType(originalName string, pkg string, file *protogen.File) *OrmableType

Jump to

Keyboard shortcuts

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