Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsFieldKindSupported ¶
IsFieldKindSupported checks if a specific reflect kind of the field is supported by the Builder.
Types ¶
type FieldInfo ¶
type FieldInfo struct {
// Name contains name of the field.
Name string
// OverrideColumnName is the name of the column in the database table.
OverrideColumnName string
// OverrideColumnType is the type of the column in the database table.
OverrideColumnType string
// Default contains default value for the field.
Default string
// Unique is set to true if the field is marked with a tag 'uniq'.
Unique bool
// Password is set to true if the field is marked with a "password" tag.
Password bool
// Ignored is set to true if the field is marked with a "-" tag.
Ignored bool
}
type StructInfo ¶
type StructInfo struct {
// Name of the struct.
Name string
// ModificationFields indicates whether the struct has the following fields: CreatedAt, CreatedBy, ModifiedAt, ModifiedBy.
ModificationFields bool
// TableName is the name of the table in the database.
TableName string
// AliasedColumnNames set to true indicates that some column names are in a format of "alias.column_name".
AliasedColumnNames bool
// Fields contains info on fields.
Fields map[string]*FieldInfo
// FieldNames contains an ordered list of field names.
FieldNames []string
// UniqueFields contains a list of field names that are marked with a tag 'uniq'.
UniqueFields []string
// PasswordFields contains a list of field names that are marked with a tag 'pass'.
PasswordFields []string
}
func New ¶
func New(obj interface{}, tagName string) *StructInfo
Click to show internal directories.
Click to hide internal directories.