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 ¶
func NewFieldPath(part string) *fieldPath
func SetSupportedFeaturesOnCodeGeneratorResponse ¶
func SetSupportedFeaturesOnCodeGeneratorResponse(resp *pluginpb.CodeGeneratorResponse)
SetSupportedFeaturesOnCodeGeneratorResponse sets supported proto3 features on pluginpb.CodeGeneratorResponse.
func SetSupportedFeaturesOnPluginGen ¶
SetSupportedFeaturesOnPluginGen sets supported proto3 features on protogen.Plugin.
Types ¶
type Field ¶
type Field struct { *gormopts.GormFieldOptions ParentGoType string TypeName string Type *OrmableType Package string ParentOrigName string FieldAssociationInfo fieldAssociationInfo }
type ORMBuilder ¶
type ORMBuilder struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts protogen.Options, request *pluginpb.CodeGeneratorRequest) (*ORMBuilder, error)
func (*ORMBuilder) Generate ¶
func (b *ORMBuilder) Generate() (*pluginpb.CodeGeneratorResponse, error)
func (*ORMBuilder) IsAbleToMakePQArray ¶
func (b *ORMBuilder) IsAbleToMakePQArray(fieldType string) bool
func (*ORMBuilder) IsIDFieldOptional ¶
func (b *ORMBuilder) IsIDFieldOptional(message *protogen.Message) bool
IsIDFieldOptional if the ID is an optional field
type OrmableType ¶
type OrmableType struct { File *protogen.File Fields map[string]*Field Methods []*autogenMethod Name string OriginName string Package string }
func GetOrmable ¶
func GetOrmable(ormableTypes map[string]*OrmableType, typeName string) (*OrmableType, error)
func NewOrmableType ¶
func NewOrmableType(originalName string, pkg string, file *protogen.File) *OrmableType
Click to show internal directories.
Click to hide internal directories.