plugin

package
v0.0.0-...-cfcc7ab Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const SUPPORTS_OPTIONAL_FIELDS = 1

I can't find where the constant is for this in protogen, so I'm putting it here.

Variables

This section is empty.

Functions

func ApplyTemplate

func ApplyTemplate(gf *protogen.GeneratedFile, f *protogen.File) (err error)

Types

type Model

type Model struct {
	*protogen.Message
	Name                    string
	TableName               string
	Fields                  []*ModelField
	HasReplaceRelationships bool
}

func (*Model) Parse

func (m *Model) Parse() (err error)

type ModelField

type ModelField struct {
	*protogen.Field
	ModelType                      string
	ModelSingularType              string
	Tag                            string
	Options                        *gorm.GormFieldOptions
	IsMessage                      bool
	IsRepeated                     bool
	IsTimestamp                    bool
	IsStructPb                     bool
	IsJsonb                        bool
	IsPointer                      bool
	IsOptional                     bool
	Comments                       string
	Ignore                         bool
	Name                           string
	ShouldGenerateBelongsToIdField bool
	HasReplaceRelationships        bool // any relationships except belongs to needs replace calls
	TimeFormat                     string
	QualifiedName                  string
}

func (*ModelField) Parse

func (f *ModelField) Parse() (err error)

type PluginOptions

type PluginOptions struct {
	EnumsAsInts bool
	Engine      string
}

type PreparedMessage

type PreparedMessage struct {
	*protogen.Message
	*Model
	PluginOptions
	Options                 *gorm.GormMessageOptions
	Ignore                  bool
	Engine                  string
	HasReplaceRelationships bool
}

func (*PreparedMessage) Parse

func (pm *PreparedMessage) Parse() (err error)

Jump to

Keyboard shortcuts

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