Documentation ¶
Index ¶
- Variables
- func Array(element string) array
- func Enum(choices ...string) enum
- func Field(name string, typeName string, flags ...FieldItem) field
- func ForeignKey(foreignModelName string) fieldForeignKey
- func Model(name string, items ...ModelItem) model
- func ModelForeignKey(foreignModelName string, columnNames ...string) modelForeignKey
- func Run(items ...gen.ConfigItem)
- func Struct(items ...ModelItem) structType
- func Tag(key string, value string) fieldTag
- func Type(name string, t TypeDef) typeEntry
- type BaseType
- type FieldItem
- type ModelItem
- type Plugin
- type SQLType
- type TxtToMany
- type TxtToOne
- type TypeDef
- type Validation
Constants ¶
This section is empty.
Variables ¶
View Source
var Index fieldIndex = func(names ...string) modelIndex {
return modelIndex{names: names}
}
View Source
var Null fieldNull
View Source
var PrimaryKey fieldPrimaryKey = func(names ...string) modelPrimaryKey {
return modelPrimaryKey{names: names}
}
View Source
var Unique fieldUnique = func(names ...string) modelUnique {
return modelUnique{names: names}
}
Functions ¶
func ForeignKey ¶
func ForeignKey(foreignModelName string) fieldForeignKey
func ModelForeignKey ¶
func Run ¶
func Run(items ...gen.ConfigItem)
Types ¶
type BaseType ¶
func (BaseType) ResolveTypes ¶
type Plugin ¶
type Plugin struct { ModelTemplates *gen.TemplateList StructTemplates *gen.TemplateList EnumTemplates *gen.TemplateList SingletonTemplates *gen.TemplateList }
func (*Plugin) BunnyPlugin ¶
func (p *Plugin) BunnyPlugin()
func (*Plugin) IsConfigItem ¶
func (*Plugin) IsConfigItem()
type TxtToMany ¶
type TxtToMany struct { LocalModel struct { NameGo string ColumnNameGo string } ForeignModel struct { NameGo string NamePluralGo string NameHumanReadable string ColumnNameGo string Slice string } Function struct { Name string ForeignName string NameGo string ForeignNameGo string UsesBytes bool LocalAssignment string ForeignAssignment string } }
TxtToMany contains text that will be used by many-to-one relationships.
type TxtToOne ¶
type TxtToOne struct { ForeignKey *schema.ForeignKey LocalModel struct { NameGo string ColumnNameGo string } ForeignModel struct { NameGo string NamePluralGo string ColumnNameGo string ColumnName string } Function struct { Name string ForeignName string NameGo string ForeignNameGo string UsesBytes bool LocalAssignment string ForeignAssignment string } }
TxtToOne contains text that will be used by templates for a one-to-many or a one-to-one relationship.
type Validation ¶
type Validation struct {
// contains filtered or unexported fields
}
func (*Validation) AddError ¶
func (v *Validation) AddError(message string, args ...interface{})
Click to show internal directories.
Click to hide internal directories.