Documentation
¶
Index ¶
- Constants
- Variables
- func FormatName(name string) string
- func Plugins(dst interface{}, columns []string, targets []interface{}) error
- func ResolveStructValue(dst interface{}) (map[string]interface{}, error)
- func Scan(rows *sql.Rows, dst interface{}) error
- func ScanAll(rows *sql.Rows, dst interface{}) error
- func ScanRow(rows *sql.Rows, dst interface{}) error
- func SnakeString(s string) string
- func Targets(dst interface{}, columns []string) ([]interface{}, error)
- func UpdateModel(dst interface{}, list map[string]interface{}) error
- type StructData
- type StructField
Constants ¶
View Source
const TagKey = "db"
TagKey parse struct tag
Variables ¶
View Source
var Debug = false
Debug 模式
Functions ¶
func Plugins ¶
Plugins .. see https://github.com/russross/meddler/blob/038a8ef02b66198d4db78da3e9830fde52a7e072/meddler.go
func ResolveStructValue ¶
ResolveStructValue 解析模型数据到 非零值不解析
func UpdateModel ¶
UpdateModel ..
Types ¶
type StructData ¶
type StructData struct { Uniques []string Indexs []string // contains filtered or unexported fields }
StructData 模型
func ResolveModelStruct ¶
func ResolveModelStruct(dst interface{}) (*StructData, error)
ResolveModelStruct 解析模型
func (StructData) GetStructField ¶
func (s StructData) GetStructField(k string) *StructField
GetStructField ..
type StructField ¶
type StructField struct {
// contains filtered or unexported fields
}
StructField 模型字段
Click to show internal directories.
Click to hide internal directories.