Documentation
¶
Index ¶
- func CopyFields(src, dest interface{})
- func CreateMarshalType(model interface{}, sch schema.Schema) interface{}
- func ExtractModelIDs(schema schema.Schema, anonModel interface{}) map[string]interface{}
- func GetDBSchema(model interface{}, db *gorm.DB) schema.Schema
- func MapToModel(inMap map[string]interface{}, model interface{}, sch schema.Schema)
- func MatchAllMapToModel(dataMap map[string]interface{}, schema schema.Schema) error
- func MatchAnyMapToModel(dataMap map[string]interface{}, schema schema.Schema) error
- func ModelToMap(model interface{}, sch schema.Schema) map[string]interface{}
- func New(t interface{}) interface{}
- func NewModel(model interface{}) interface{}
- type ColumnInfo
- type ModelColumnInfo
- type StringSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFields ¶ added in v0.1.1
func CopyFields(src, dest interface{})
Copy equivalent fields from one interface{} to another Fields must have the same field names and the interfaces should be pointers to model-like structs
func CreateMarshalType ¶ added in v0.1.1
Creates a runtime type that has form, json, xml tags for marshalling to/from json By default uses the db name from the schema.
func ExtractModelIDs ¶
func MapToModel ¶ added in v0.1.1
Convert map to gorm Model
func MatchAllMapToModel ¶
func MatchAnyMapToModel ¶
func ModelToMap ¶ added in v0.1.1
Convert gorm model to map
Types ¶
type ColumnInfo ¶ added in v0.1.1
type ModelColumnInfo ¶ added in v0.1.1
type ModelColumnInfo map[string]ColumnInfo
func GetModelColumnInfo ¶ added in v0.1.1
func GetModelColumnInfo(model interface{}, db *gorm.DB) ModelColumnInfo
Click to show internal directories.
Click to hide internal directories.