Documentation
¶
Index ¶
Constants ¶
View Source
const ( TagKeyGorm = "gorm" TagKeyJson = "json" //gorm tag TagKeyGormColumn = "column" TagKeyGormType = "type" TagKeyGormPrimaryKey = "primaryKey" TagKeyGormAutoIncrement = "autoIncrement" TagKeyGormNotNull = "not null" TagKeyGormUniqueIndex = "uniqueIndex" TagKeyGormIndex = "index" TagKeyGormDefault = "default" TagKeyGormComment = "comment" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldConfig ¶
type FieldConfig struct {
//gorm.ColumnType
//TableName string `gorm:"column:TABLE_NAME"`
//Indexes []*Index `gorm:"-"`
UseScanType bool `gorm:"-"`
DataTypeMap map[string]func(columnType gorm.ColumnType) (dataType string)
FieldNullable bool // generate pointer when field is nullable
FieldCoverable bool // generate pointer when field has default value
FieldSignable bool // detect integer field's unsigned type, adjust generated data type
FieldWithIndexTag bool // generate with gorm index tag
FieldWithTypeTag bool // generate with gorm column type tag
FieldNameNS func(columnName string) string
FieldJSONTagNS func(columnName string) string
// contains filtered or unexported fields
}
func (*FieldConfig) SetDataTypeMap ¶
func (c *FieldConfig) SetDataTypeMap(m map[string]func(columnType gorm.ColumnType) (dataType string))
SetDataTypeMap set data type map
func (*FieldConfig) WithNS ¶
func (c *FieldConfig) WithNS(jsonTagNS func(columnName string) string)
WithNS with name strategy
type TagBuilder ¶
type TagBuilder interface {
Build() string
}
Click to show internal directories.
Click to hide internal directories.