Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TableFieldsSeq ¶
func TableFieldsSeq(v any) iter.Seq[*TableField]
Types ¶
type Field ¶
type Field struct {
ColumnName string
FieldName string
Type typx.Type
Field typx.StructField
Flag *reflectx.Flag
Loc []int
ColumnDef def.ColumnDef
}
func FieldsFor ¶
Example ¶
fields := structs.FieldsFor(typx.NewRType(reflect.TypeFor[User]()))
for _, f := range fields {
fmt.Printf("%-10s %-6s %v\n", f.ColumnName, f.Type.Name(), f.Loc)
}
seq := structs.FieldsSeqFor(typx.NewRType(reflect.TypeFor[User]()))
for f := range seq {
fmt.Printf("%-10s %-6s %v\n", f.ColumnName, f.Type.Name(), f.Loc)
}
Output: f_id uint64 [0 0] f_user_id uint64 [1 0] f_org_id uint64 [2 0] f_name string [3 0] f_age int [3 1] f_id uint64 [0 0] f_user_id uint64 [1 0] f_org_id uint64 [2 0] f_name string [3 0] f_age int [3 1]
func (*Field) ModelValue ¶
type TableField ¶
func TableFields ¶
func TableFields(v any) []*TableField
Click to show internal directories.
Click to hide internal directories.