Documentation ¶
Index ¶
- Variables
- func GetGoedbTagTypeAndValue(instanceType reflect.Type, instanceValue reflect.Value, goedbTag string) (reflect.Type, reflect.Value, error)
- func GetGoedbTagTypeAndValueOfIndexField(instanceType reflect.Type, instanceValue reflect.Value, goedbTag string, ...) (reflect.Type, reflect.Value, error)
- func GetType(i interface{}) reflect.Type
- func GetValue(i interface{}) reflect.Value
- func StructToSliceOfAddresses(structPtr interface{}) []interface{}
- func StructToSliceOfAddressesWithRules(structPtr interface{}) []interface{}
- type GoedbColumn
- type GoedbTable
Constants ¶
This section is empty.
Variables ¶
View Source
var Models map[string]GoedbTable
Models contains every model migrated
Functions ¶
func GetGoedbTagTypeAndValue ¶
func GetGoedbTagTypeAndValue(instanceType reflect.Type, instanceValue reflect.Value, goedbTag string) (reflect.Type, reflect.Value, error)
GetGoedbTagTypeAndValue returns the tag and the value of a struct
func GetGoedbTagTypeAndValueOfIndexField ¶
func GetGoedbTagTypeAndValueOfIndexField(instanceType reflect.Type, instanceValue reflect.Value, goedbTag string, fieldID int) (reflect.Type, reflect.Value, error)
GetGoedbTagTypeAndValueOfIndexField returns the type and the value of a index field
func StructToSliceOfAddresses ¶
func StructToSliceOfAddresses(structPtr interface{}) []interface{}
StructToSliceOfAddresses returns a slice with the addresses of each struct field, so any modification on the slide will modify the source struct fields
func StructToSliceOfAddressesWithRules ¶
func StructToSliceOfAddressesWithRules(structPtr interface{}) []interface{}
StructToSliceOfAddressesWithRules returns a slice with the addresses of each struct field, so any modification on the slide will modify the source struct fields
Types ¶
type GoedbColumn ¶
type GoedbColumn struct { Title string ColumnType reflect.Kind ColumnTypeName string PrimaryKey bool Unique bool ForeignKey bool ForeignKeyReference string AutoIncrement bool IsComplex bool Ignore bool }
GoedbColumn represents the metadata of a column
type GoedbTable ¶
type GoedbTable struct { Name string Columns []GoedbColumn PrimaryKeyName string `json:"-"` PrimaryKeyType reflect.Kind `json:"-"` }
GoedbTable represents the metadata of a table
func ParseModel ¶
func ParseModel(entity interface{}) GoedbTable
ParseModel generates a GoedbTable, the model of a struct
Click to show internal directories.
Click to hide internal directories.