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 SetModelValue(vModel model.Model, vVal model.Value) (ret model.Model, err error)
- type Item
- type ItemValue
- 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 ObjectValue
- type SliceObjectValue
- 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, err error)
- func (s *TypeImpl) IsBasic() bool
- func (s *TypeImpl) IsPtrType() (ret bool)
- type ValueImpl
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)
Types ¶
type Item ¶
type Item struct { Index int `json:"index"` Name string `json:"name"` Tag *TagImpl `json:"tag"` Type *TypeImpl `json:"type"` // contains filtered or unexported fields }
Item Item
type ItemValue ¶
type ItemValue struct { Name string `json:"name"` Value interface{} `json:"value"` }
ItemValue item value
func ConvertItem ¶
ConvertItem convert ItemValue
type Object ¶
type Object struct { Name string `json:"name"` PkgPath string `json:"pkgPath"` IsPtr bool `json:"isPtr"` Items []*Item `json:"items"` }
Object Object
func DecodeObject ¶
func (*Object) GetPrimaryField ¶
GetPrimaryField GetPrimaryField
type ObjectValue ¶
type ObjectValue struct { Name string `json:"name"` PkgPath string `json:"pkgPath"` IsPtr bool `json:"isPtr"` Items []*ItemValue `json:"items"` }
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"` IsPtr bool `json:"isPtr"` 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 (*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
IsElemPtr isPtrValue
func (*SliceObjectValue) IsPtrValue ¶
func (s *SliceObjectValue) IsPtrValue() bool
IsPtrValue isPtrValue
type TagImpl ¶
type TagImpl struct {
Value string `json:"value"`
}
TagImpl TagImpl
func (*TagImpl) IsAutoIncrement ¶
IsAutoIncrement IsAutoIncrement
func (*TagImpl) IsPrimaryKey ¶
IsPrimaryKey IsPrimaryKey
type TypeImpl ¶
type TypeImpl struct { Name string `json:"name"` Value int `json:"value"` PkgPath string `json:"pkgPath"` IsPtr bool `json:"isPtr"` ElemType *TypeImpl `json:"elemType"` }
TypeImpl TypeImpl