Documentation ¶
Index ¶
- Constants
- Variables
- func AppendSliceValue(sliceVal model.Value, vVal model.Value) (ret model.Value, err *cd.Result)
- func CompareObject(l, r *Object) bool
- func CompareObjectValue(l, r *ObjectValue) bool
- func CompareSliceObjectValue(l, r *SliceObjectValue) bool
- func DecodeValue(tVal model.RawVal, tType model.Type, mCache model.Cache) (ret model.Value, err *cd.Result)
- func ElemDependValue(eVal model.RawVal) (ret []model.Value, err *cd.Result)
- func EncodeObjectValue(objVal *ObjectValue) (ret []byte, err *cd.Result)
- func EncodeSliceObjectValue(objVal *SliceObjectValue) (ret []byte, err *cd.Result)
- func EncodeValue(tVal model.Value, tType model.Type, mCache model.Cache) (ret model.RawVal, err *cd.Result)
- func GetEntityModel(entity interface{}) (ret model.Model, err *cd.Result)
- func GetEntityType(entity interface{}) (ret model.Type, err *cd.Result)
- func GetEntityValue(entity interface{}) (ret model.Value, err *cd.Result)
- func GetModelFilter(vModel model.Model) (ret model.Filter, err *cd.Result)
- func GetNewValue(valueDeclare model.ValueDeclare) (ret model.Value)
- func SetModelValue(vModel model.Model, vVal model.Value) (ret model.Model, err *cd.Result)
- type Field
- func (s *Field) GetDescription() string
- func (s *Field) GetName() string
- func (s *Field) GetSpec() (ret model.Spec)
- func (s *Field) GetType() (ret model.Type)
- func (s *Field) GetValue() (ret model.Value)
- func (s *Field) IsBasic() bool
- func (s *Field) IsPrimaryKey() bool
- func (s *Field) IsPtrType() bool
- func (s *Field) IsSlice() bool
- func (s *Field) IsStruct() bool
- func (s *Field) SetValue(val model.Value)
- type FieldValue
- type Object
- func (s *Object) Copy(reset bool) (ret model.Model)
- func (s *Object) Dump() (ret string)
- func (s *Object) GetDescription() (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(_ bool, viewSpec model.ViewDeclare) (ret any)
- func (s *Object) SetFieldValue(name string, val model.Value)
- func (s *Object) SetPrimaryFieldValue(val model.Value)
- func (s *Object) Verify() (err *cd.Result)
- type ObjectFilter
- func (s *ObjectFilter) Above(key string, val any) (err *cd.Result)
- func (s *ObjectFilter) Below(key string, val any) (err *cd.Result)
- func (s *ObjectFilter) Equal(key string, val any) (err *cd.Result)
- 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) GetPkgKey() string
- func (s *ObjectFilter) GetPkgPath() string
- func (s *ObjectFilter) GetString(key string) (ret string, ok bool)
- func (s *ObjectFilter) In(key string, val any) (err *cd.Result)
- func (s *ObjectFilter) Like(key string, val any) (err *cd.Result)
- func (s *ObjectFilter) MaskModel() om.Model
- func (s *ObjectFilter) NotEqual(key string, val any) (err *cd.Result)
- func (s *ObjectFilter) NotIn(key string, val any) (err *cd.Result)
- 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 any) (err *cd.Result)
- type ObjectValue
- func (s *ObjectValue) Copy() (ret *ObjectValue)
- func (s *ObjectValue) GetFieldValue(name string) any
- func (s *ObjectValue) GetName() string
- func (s *ObjectValue) GetPkgKey() string
- func (s *ObjectValue) GetPkgPath() string
- func (s *ObjectValue) GetValue() []*FieldValue
- func (s *ObjectValue) IsAssigned() (ret bool)
- func (s *ObjectValue) SetFieldValue(name string, value any)
- type SliceObjectValue
- func ConvertSliceObjectValue(objVal *SliceObjectValue) (ret *SliceObjectValue, err *cd.Result)
- func DecodeSliceObjectValue(data []byte) (ret *SliceObjectValue, err *cd.Result)
- func GetSliceObjectValue(sliceEntity any) (ret *SliceObjectValue, err *cd.Result)
- func TransferObjectValue(name, pkgPath string, vals []*ObjectValue) (ret *SliceObjectValue)
- type SpecImpl
- type TypeImpl
- func (s *TypeImpl) Elem() model.Type
- func (s *TypeImpl) GetDescription() (ret string)
- func (s *TypeImpl) GetName() (ret string)
- func (s *TypeImpl) GetPkgKey() string
- func (s *TypeImpl) GetPkgPath() (ret string)
- func (s *TypeImpl) GetValue() (ret model.TypeDeclare)
- func (s *TypeImpl) Interface(initVal any) (ret model.Value, err *cd.Result)
- func (s *TypeImpl) IsBasic() bool
- func (s *TypeImpl) IsPtrType() (ret bool)
- func (s *TypeImpl) IsSlice() bool
- func (s *TypeImpl) IsStruct() bool
- type ValueImpl
- func (s *ValueImpl) Addr() model.Value
- func (s *ValueImpl) Copy() (ret *ValueImpl)
- func (s *ValueImpl) Get() any
- func (s *ValueImpl) Interface() model.RawVal
- func (s *ValueImpl) IsBasic() bool
- func (s *ValueImpl) IsValid() (ret bool)
- func (s *ValueImpl) IsZero() (ret bool)
- func (s *ValueImpl) Set(val any)
Constants ¶
View Source
const ( NameTag = "name" PkgPathTag = "pkgPath" FieldsTag = "fields" ValuesTag = "values" ValueTag = "value" )
Variables ¶
View Source
var NilValue = ValueImpl{}
Functions ¶
func AppendSliceValue ¶
func CompareObject ¶ added in v1.3.28
func CompareObjectValue ¶
func CompareObjectValue(l, r *ObjectValue) bool
func CompareSliceObjectValue ¶ added in v1.3.28
func CompareSliceObjectValue(l, r *SliceObjectValue) bool
func DecodeValue ¶
func EncodeObjectValue ¶
func EncodeObjectValue(objVal *ObjectValue) (ret []byte, err *cd.Result)
EncodeObjectValue encode objectValue to []byte
func EncodeSliceObjectValue ¶
func EncodeSliceObjectValue(objVal *SliceObjectValue) (ret []byte, err *cd.Result)
EncodeSliceObjectValue encode slice objectValue to []byte
func EncodeValue ¶
func GetModelFilter ¶ added in v1.3.4
func GetNewValue ¶ added in v1.3.147
func GetNewValue(valueDeclare model.ValueDeclare) (ret model.Value)
Types ¶
type Field ¶ added in v1.3.4
type Field struct { Name string `json:"name"` Description string `json:"description"` Type *TypeImpl `json:"type"` Spec *SpecImpl `json:"spec"` // contains filtered or unexported fields }
func (*Field) GetDescription ¶ added in v1.3.28
func (*Field) IsPrimaryKey ¶ added in v1.3.28
type FieldValue ¶ added in v1.3.4
func ConvertItem ¶
func ConvertItem(val *FieldValue) (ret *FieldValue, err *cd.Result)
func (*FieldValue) Get ¶ added in v1.3.4
func (s *FieldValue) Get() any
func (*FieldValue) GetName ¶ added in v1.3.28
func (s *FieldValue) GetName() string
func (*FieldValue) GetValue ¶ added in v1.3.28
func (s *FieldValue) GetValue() model.Value
func (*FieldValue) IsNil ¶ added in v1.3.4
func (s *FieldValue) IsNil() bool
func (*FieldValue) IsZero ¶ added in v1.3.28
func (s *FieldValue) IsZero() bool
func (*FieldValue) Set ¶ added in v1.3.4
func (s *FieldValue) Set(val any)
type Object ¶
type Object struct { ID int64 `json:"id"` Name string `json:"name"` PkgPath string `json:"pkgPath"` Description string `json:"description"` Fields []*Field `json:"fields"` }
func (*Object) GetDescription ¶ added in v1.3.28
func (*Object) GetPkgPath ¶
func (*Object) GetPrimaryField ¶
func (*Object) Interface ¶
func (s *Object) Interface(_ bool, viewSpec model.ViewDeclare) (ret any)
Interface object value
func (*Object) SetPrimaryFieldValue ¶ added in v1.3.89
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 any) (err *cd.Result)
func (*ObjectFilter) Below ¶ added in v1.3.3
func (s *ObjectFilter) Below(key string, val any) (err *cd.Result)
func (*ObjectFilter) Equal ¶ added in v1.3.3
func (s *ObjectFilter) Equal(key string, val any) (err *cd.Result)
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) GetPkgKey ¶ added in v1.3.49
func (s *ObjectFilter) GetPkgKey() 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 any) (err *cd.Result)
func (*ObjectFilter) Like ¶ added in v1.3.3
func (s *ObjectFilter) Like(key string, val any) (err *cd.Result)
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 any) (err *cd.Result)
func (*ObjectFilter) NotIn ¶ added in v1.3.3
func (s *ObjectFilter) NotIn(key string, val any) (err *cd.Result)
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
type ObjectValue ¶
type ObjectValue struct { ID string `json:"id"` Name string `json:"name"` PkgPath string `json:"pkgPath"` Fields []*FieldValue `json:"fields"` }
ObjectValue Object value
func ConvertObjectValue ¶
func ConvertObjectValue(objVal *ObjectValue) (ret *ObjectValue, err *cd.Result)
ConvertObjectValue convert object value
func DecodeObjectValue ¶
func DecodeObjectValue(data []byte) (ret *ObjectValue, err *cd.Result)
DecodeObjectValue decode objectValue
func GetObjectValue ¶
func GetObjectValue(entity any) (ret *ObjectValue, err *cd.Result)
GetObjectValue get object value
func (*ObjectValue) Copy ¶ added in v1.3.28
func (s *ObjectValue) Copy() (ret *ObjectValue)
func (*ObjectValue) GetFieldValue ¶ added in v1.3.106
func (s *ObjectValue) GetFieldValue(name string) any
func (*ObjectValue) GetName ¶
func (s *ObjectValue) GetName() string
func (*ObjectValue) GetPkgKey ¶ added in v1.3.0
func (s *ObjectValue) GetPkgKey() string
func (*ObjectValue) GetPkgPath ¶
func (s *ObjectValue) GetPkgPath() string
func (*ObjectValue) GetValue ¶ added in v1.3.44
func (s *ObjectValue) GetValue() []*FieldValue
func (*ObjectValue) IsAssigned ¶
func (s *ObjectValue) IsAssigned() (ret bool)
func (*ObjectValue) SetFieldValue ¶ added in v1.3.51
func (s *ObjectValue) SetFieldValue(name string, value any)
type SliceObjectValue ¶
type SliceObjectValue struct { Name string `json:"name"` PkgPath string `json:"pkgPath"` Values []*ObjectValue `json:"values"` }
SliceObjectValue slice object value
func ConvertSliceObjectValue ¶
func ConvertSliceObjectValue(objVal *SliceObjectValue) (ret *SliceObjectValue, err *cd.Result)
func DecodeSliceObjectValue ¶
func DecodeSliceObjectValue(data []byte) (ret *SliceObjectValue, err *cd.Result)
DecodeSliceObjectValue decode objectValue
func GetSliceObjectValue ¶
func GetSliceObjectValue(sliceEntity any) (ret *SliceObjectValue, err *cd.Result)
GetSliceObjectValue get slice object value
func TransferObjectValue ¶ added in v1.3.15
func TransferObjectValue(name, pkgPath string, vals []*ObjectValue) (ret *SliceObjectValue)
func (*SliceObjectValue) Copy ¶ added in v1.3.28
func (s *SliceObjectValue) Copy() (ret *SliceObjectValue)
func (*SliceObjectValue) GetName ¶
func (s *SliceObjectValue) GetName() string
func (*SliceObjectValue) GetPkgKey ¶ added in v1.3.28
func (s *SliceObjectValue) GetPkgKey() string
func (*SliceObjectValue) GetPkgPath ¶
func (s *SliceObjectValue) GetPkgPath() string
func (*SliceObjectValue) GetValue ¶ added in v1.3.44
func (s *SliceObjectValue) GetValue() []*ObjectValue
func (*SliceObjectValue) IsAssigned ¶
func (s *SliceObjectValue) IsAssigned() (ret bool)
type SpecImpl ¶ added in v1.3.23
type SpecImpl struct { FieldName string `json:"fieldName"` PrimaryKey bool `json:"primaryKey"` ValueDeclare model.ValueDeclare `json:"valueDeclare"` ViewDeclare []model.ViewDeclare `json:"viewDeclare"` DefaultValue any `json:"defaultValue"` }
func (SpecImpl) EnableView ¶ added in v1.3.90
func (s SpecImpl) EnableView(viewSpec model.ViewDeclare) bool
func (SpecImpl) GetDefaultValue ¶ added in v1.3.156
func (SpecImpl) GetFieldName ¶ added in v1.3.23
func (SpecImpl) GetValueDeclare ¶ added in v1.3.28
func (s SpecImpl) GetValueDeclare() model.ValueDeclare
func (SpecImpl) IsPrimaryKey ¶ added in v1.3.23
type TypeImpl ¶
type TypeImpl struct { Name string `json:"name"` PkgPath string `json:"pkgPath"` Description string `json:"description"` Value model.TypeDeclare `json:"value"` IsPtr bool `json:"isPtr"` ElemType *TypeImpl `json:"elemType"` }
func (*TypeImpl) GetDescription ¶ added in v1.3.28
func (*TypeImpl) GetPkgPath ¶
func (*TypeImpl) GetValue ¶
func (s *TypeImpl) GetValue() (ret model.TypeDeclare)
Click to show internal directories.
Click to hide internal directories.