Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareField ¶
func CompareModel ¶
func CompareTag ¶
func CompareType ¶
func CompareValue ¶
Types ¶
type Cache ¶
type Cache interface { Reset() Put(name string, info Model) Fetch(name string) Model Remove(name string) }
Cache Model Cache
type Field ¶
type Field interface { //@GetIndex Index GetIndex() int //@GetName Name GetName() string //@GetType Type GetType() Type //@GetTag Tag GetTag() Tag //@GetValue Value GetValue() Value //@SetValue 更新值 SetValue(val Value) error //@IsPrimary 是否主键 IsPrimary() bool }
Field Field
type Fields ¶
type Fields []Field
Fields field info collection
func (*Fields) GetPrimaryField ¶
GetPrimaryField get primary key field
type Filter ¶
type Filter interface { Equal(key string, val interface{}) error NotEqual(key string, val interface{}) error Below(key string, val interface{}) error Above(key string, val interface{}) error In(key string, val interface{}) error NotIn(key string, val interface{}) error Like(key string, val interface{}) error ValueMask(val interface{}) error Page(filter *util.Pagination) Sort(sorter *util.SortFilter) GetFilterItem(name string) FilterItem Pagination() (limit, offset int, paging bool) MaskModel() Model Sorter() Sorter }
Filter orm query filter
type FilterItem ¶
FilterItem FilterItem
type Model ¶
type Model interface { GetName() string GetPkgPath() string GetFields() Fields SetFieldValue(name string, val Value) error GetPrimaryField() Field GetField(name string) Field Interface(ptrValue bool) interface{} Copy() Model Dump() string }
Model Model
type Tag ¶
type Tag interface { // Tag名称 GetName() string // 是否是主键 IsPrimaryKey() bool // 是否自增 IsAutoIncrement() bool }
Tag Tag
type Type ¶
type Type interface { // @GetName 名称 GetName() string // @GetValue 值 GetValue() int // @GetPkgPath pkgPath GetPkgPath() string // @IsPtrType 是否指针类型 IsPtrType() bool // @Interface 实例化一个类型对应的数据值 Interface() (Value, error) // Elem 获取要素类型(如果非slice,则返回的是本身,如果是slice,则返回slice的elem类型) Elem() Type // @IsBasic 判断是否基础类型(不是struct,也不是slice struct) IsBasic() bool }
Type Type
Click to show internal directories.
Click to hide internal directories.