Documentation ¶
Index ¶
- func AppendSliceValue(sliceVal model.Value, vVal model.Value) (ret model.Value, err error)
- func CompareObjectValue(l, r *ObjectValue) bool
- func DecodeValue(tVal interface{}, tType model.Type, mCache model.Cache) (ret model.Value, err error)
- func ElemDependValue(vVal model.Value) (ret []model.Value, err error)
- func EncodeObject(objPtr *Object) (ret []byte, err error)
- func EncodeObjectValue(objVal *ObjectValue) (ret []byte, err error)
- func EncodeSliceObjectValue(objVal *SliceObjectValue) (ret []byte, err error)
- func EncodeValue(tVal model.Value, tType model.Type, mCache model.Cache) (ret interface{}, err error)
- func GetEntityModel(entity interface{}) (ret model.Model, err error)
- func GetEntityType(entity interface{}) (ret model.Type, err error)
- func GetEntityValue(entity interface{}) (ret model.Value, err error)
- func GetHelper() helper.Helper
- func GetMapValue(entity interface{}) (ret interface{}, err error)
- func GetModelFilter(vModel model.Model) (ret model.Filter, err error)
- func SetModelValue(vModel model.Model, vVal model.Value) (ret model.Model, err error)
- type Field
- type FieldValue
- type Object
- func (s *Object) Copy() (ret model.Model)
- func (s *Object) Dump() (ret string)
- func (s *Object) GetField(name string) (ret model.Field)
- func (s *Object) GetFields() (ret model.Fields)
- func (s *Object) GetName() (ret string)
- func (s *Object) GetPkgKey() string
- func (s *Object) GetPkgPath() (ret string)
- func (s *Object) GetPrimaryField() (ret model.Field)
- func (s *Object) Interface(ptrValue bool) (ret interface{})
- func (s *Object) IsPtrValue() bool
- func (s *Object) SetFieldValue(name string, val model.Value) (err error)
- type ObjectFilter
- func (s *ObjectFilter) Above(key string, val interface{}) (err error)
- func (s *ObjectFilter) Below(key string, val interface{}) (err error)
- func (s *ObjectFilter) Equal(key string, val interface{}) (err error)
- func (s *ObjectFilter) GetFilterItem(key string) om.FilterItem
- func (s *ObjectFilter) GetInt(key string) (ret int, ok bool)
- func (s *ObjectFilter) GetName() string
- func (s *ObjectFilter) GetPkgPath() string
- func (s *ObjectFilter) GetString(key string) (ret string, ok bool)
- func (s *ObjectFilter) In(key string, val interface{}) (err error)
- func (s *ObjectFilter) Like(key string, val interface{}) (err error)
- func (s *ObjectFilter) MaskModel() om.Model
- func (s *ObjectFilter) NotEqual(key string, val interface{}) (err error)
- func (s *ObjectFilter) NotIn(key string, val interface{}) (err error)
- func (s *ObjectFilter) Page(filter *util.Pagination)
- func (s *ObjectFilter) Pagination() (limit, offset int, paging bool)
- func (s *ObjectFilter) Sort(sorter *util.SortFilter)
- func (s *ObjectFilter) Sorter() om.Sorter
- func (s *ObjectFilter) ValueMask(val interface{}) (err error)
- type ObjectValue
- type SliceObjectValue
- func ConvertSliceObjectValue(objVal *SliceObjectValue) (ret *SliceObjectValue, err error)
- func DecodeSliceObjectValue(data []byte) (ret *SliceObjectValue, err error)
- func GetSliceObjectValue(sliceEntity interface{}) (ret *SliceObjectValue, err error)
- func TransferObjectValue(vals []*ObjectValue) (ret *SliceObjectValue, err error)
- type TagImpl
- type TypeImpl
- func (s *TypeImpl) Elem() model.Type
- func (s *TypeImpl) GetName() (ret string)
- func (s *TypeImpl) GetPkgKey() string
- func (s *TypeImpl) GetPkgPath() (ret string)
- func (s *TypeImpl) GetValue() (ret int)
- func (s *TypeImpl) Interface() (ret model.Value)
- func (s *TypeImpl) IsBasic() bool
- func (s *TypeImpl) IsPtrType() (ret bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSliceValue ¶
func CompareObjectValue ¶
func CompareObjectValue(l, r *ObjectValue) bool
func DecodeValue ¶
func EncodeObject ¶
func EncodeObjectValue ¶
func EncodeObjectValue(objVal *ObjectValue) (ret []byte, err error)
EncodeObjectValue encode objectValue to []byte
func EncodeSliceObjectValue ¶
func EncodeSliceObjectValue(objVal *SliceObjectValue) (ret []byte, err error)
EncodeSliceObjectValue encode slice objectValue to []byte
func EncodeValue ¶
func GetEntityModel ¶
func GetEntityType ¶
func GetEntityValue ¶
func GetMapValue ¶ added in v1.2.0
func GetMapValue(entity interface{}) (ret interface{}, err error)
func GetModelFilter ¶ added in v1.3.4
Types ¶
type Field ¶ added in v1.3.4
type FieldValue ¶ added in v1.3.4
func ConvertItem ¶
func ConvertItem(val *FieldValue) (ret *FieldValue, err error)
ConvertItem convert FieldValue
func (*FieldValue) Addr ¶ added in v1.3.4
func (s *FieldValue) Addr() model.Value
func (*FieldValue) Get ¶ added in v1.3.4
func (s *FieldValue) Get() reflect.Value
func (*FieldValue) Interface ¶ added in v1.3.4
func (s *FieldValue) Interface() any
func (*FieldValue) IsBasic ¶ added in v1.3.4
func (s *FieldValue) IsBasic() bool
func (*FieldValue) IsNil ¶ added in v1.3.4
func (s *FieldValue) IsNil() bool
type Object ¶
type Object struct { Name string `json:"name"` PkgPath string `json:"pkgPath"` IsPtr bool `json:"isPtr"` Fields []*Field `json:"fields"` }
func DecodeObject ¶
func (*Object) GetPkgPath ¶
func (*Object) GetPrimaryField ¶
func (*Object) IsPtrValue ¶
type ObjectFilter ¶ added in v1.3.3
type ObjectFilter struct { Name string `json:"name"` PkgPath string `json:"pkgPath"` EqualFilter []*FieldValue `json:"equal"` NotEqualFilter []*FieldValue `json:"noEqual"` BelowFilter []*FieldValue `json:"below"` AboveFilter []*FieldValue `json:"above"` InFilter []*FieldValue `json:"in"` NotInFilter []*FieldValue `json:"notIn"` LikeFilter []*FieldValue `json:"like"` MaskValue *ObjectValue `json:"maskValue"` PageFilter *util.Pagination `json:"page"` SortFilter *util.SortFilter `json:"sort"` // contains filtered or unexported fields }
func NewFilter ¶ added in v1.3.3
func NewFilter(objectPtr *Object) *ObjectFilter
func (*ObjectFilter) Above ¶ added in v1.3.3
func (s *ObjectFilter) Above(key string, val interface{}) (err error)
func (*ObjectFilter) Below ¶ added in v1.3.3
func (s *ObjectFilter) Below(key string, val interface{}) (err error)
func (*ObjectFilter) Equal ¶ added in v1.3.3
func (s *ObjectFilter) Equal(key string, val interface{}) (err error)
func (*ObjectFilter) GetFilterItem ¶ added in v1.3.4
func (s *ObjectFilter) GetFilterItem(key string) om.FilterItem
func (*ObjectFilter) GetInt ¶ added in v1.3.3
func (s *ObjectFilter) GetInt(key string) (ret int, ok bool)
func (*ObjectFilter) GetName ¶ added in v1.3.3
func (s *ObjectFilter) GetName() string
func (*ObjectFilter) GetPkgPath ¶ added in v1.3.3
func (s *ObjectFilter) GetPkgPath() string
func (*ObjectFilter) GetString ¶ added in v1.3.3
func (s *ObjectFilter) GetString(key string) (ret string, ok bool)
func (*ObjectFilter) In ¶ added in v1.3.3
func (s *ObjectFilter) In(key string, val interface{}) (err error)
func (*ObjectFilter) Like ¶ added in v1.3.3
func (s *ObjectFilter) Like(key string, val interface{}) (err error)
func (*ObjectFilter) MaskModel ¶ added in v1.3.4
func (s *ObjectFilter) MaskModel() om.Model
func (*ObjectFilter) NotEqual ¶ added in v1.3.3
func (s *ObjectFilter) NotEqual(key string, val interface{}) (err error)
func (*ObjectFilter) NotIn ¶ added in v1.3.3
func (s *ObjectFilter) NotIn(key string, val interface{}) (err error)
func (*ObjectFilter) Page ¶ added in v1.3.3
func (s *ObjectFilter) Page(filter *util.Pagination)
func (*ObjectFilter) Pagination ¶ added in v1.3.3
func (s *ObjectFilter) Pagination() (limit, offset int, paging bool)
func (*ObjectFilter) Sort ¶ added in v1.3.3
func (s *ObjectFilter) Sort(sorter *util.SortFilter)
func (*ObjectFilter) Sorter ¶ added in v1.3.4
func (s *ObjectFilter) Sorter() om.Sorter
func (*ObjectFilter) ValueMask ¶ added in v1.3.3
func (s *ObjectFilter) ValueMask(val interface{}) (err error)
type ObjectValue ¶
type ObjectValue struct { Name string `json:"name"` PkgPath string `json:"pkgPath"` Fields []*FieldValue `json:"fields"` }
ObjectValue Object value
func ConvertObjectValue ¶
func ConvertObjectValue(objVal *ObjectValue) (ret *ObjectValue, err error)
ConvertObjectValue convert object value
func DecodeObjectValue ¶
func DecodeObjectValue(data []byte) (ret *ObjectValue, err error)
DecodeObjectValue decode objectValue
func GetObjectValue ¶
func GetObjectValue(entity interface{}) (ret *ObjectValue, err error)
GetObjectValue get object value
func (*ObjectValue) GetPkgKey ¶ added in v1.3.0
func (s *ObjectValue) GetPkgKey() string
func (*ObjectValue) IsAssigned ¶
func (s *ObjectValue) IsAssigned() (ret bool)
IsAssigned is assigned value
type SliceObjectValue ¶
type SliceObjectValue struct { Name string `json:"name"` PkgPath string `json:"pkgPath"` IsElemPtr bool `json:"isElemPtr"` Values []*ObjectValue `json:"values"` }
SliceObjectValue slice object value
func ConvertSliceObjectValue ¶
func ConvertSliceObjectValue(objVal *SliceObjectValue) (ret *SliceObjectValue, err error)
func DecodeSliceObjectValue ¶
func DecodeSliceObjectValue(data []byte) (ret *SliceObjectValue, err error)
DecodeSliceObjectValue decode objectValue
func GetSliceObjectValue ¶
func GetSliceObjectValue(sliceEntity interface{}) (ret *SliceObjectValue, err error)
GetSliceObjectValue get slice object value
func TransferObjectValue ¶ added in v1.3.15
func TransferObjectValue(vals []*ObjectValue) (ret *SliceObjectValue, err error)
func (*SliceObjectValue) GetName ¶
func (s *SliceObjectValue) GetName() string
GetName get object name
func (*SliceObjectValue) GetPkgPath ¶
func (s *SliceObjectValue) GetPkgPath() string
GetPkgPath get pkg path
func (*SliceObjectValue) IsAssigned ¶
func (s *SliceObjectValue) IsAssigned() (ret bool)
IsAssigned is assigned value
func (*SliceObjectValue) IsElemPtrValue ¶
func (s *SliceObjectValue) IsElemPtrValue() bool
type TagImpl ¶
type TagImpl struct {
Value string `json:"value"`
}
func (*TagImpl) IsAutoIncrement ¶
func (*TagImpl) IsPrimaryKey ¶
Click to show internal directories.
Click to hide internal directories.