Documentation ¶
Index ¶
- Constants
- func CompareField(l, r Field) bool
- func CompareModel(l, r Model) bool
- func CompareSpec(l, r Spec) bool
- func CompareType(l, r Type) bool
- func CompareValue(l, r Value) bool
- func IsAutoIncrement(val ValueDeclare) bool
- func IsBasicSlice(tType Type) bool
- func IsBasicType(typeValue TypeDeclare) bool
- func IsCustomer(val ValueDeclare) bool
- func IsDateTime(val ValueDeclare) bool
- func IsDateTimeType(typeValue TypeDeclare) bool
- func IsMapType(typeVal TypeDeclare) bool
- func IsSliceType(typeValue TypeDeclare) bool
- func IsSnowFlake(val ValueDeclare) bool
- func IsStructSlice(tType Type) bool
- func IsStructType(typeValue TypeDeclare) bool
- func IsUUID(val ValueDeclare) bool
- type Cache
- type Field
- type Fields
- type Filter
- type FilterItem
- type Model
- type OprCode
- type RawVal
- type Sorter
- type Spec
- type Type
- type TypeDeclare
- type Value
- type ValueDeclare
- type ViewDeclare
Constants ¶
View Source
const ( // TypeBooleanValue bool TypeBooleanValue = iota + 100 // TypeBitValue int8 TypeBitValue // TypeSmallIntegerValue int16 TypeSmallIntegerValue // TypeInteger32Value int32 TypeInteger32Value // TypeIntegerValue int TypeIntegerValue // TypeBigIntegerValue int64 TypeBigIntegerValue // TypePositiveBitValue uint8 TypePositiveBitValue // TypePositiveSmallIntegerValue uint16 TypePositiveSmallIntegerValue // TypePositiveInteger32Value uint32 TypePositiveInteger32Value // TypePositiveIntegerValue uint TypePositiveIntegerValue // TypePositiveBigIntegerValue uint64 TypePositiveBigIntegerValue // TypeFloatValue float32 TypeFloatValue // TypeDoubleValue float64 TypeDoubleValue // TypeStringValue string TypeStringValue // TypeDateTimeValue time.Time TypeDateTimeValue // TypeStructValue struct TypeStructValue // TypeSliceValue slice TypeSliceValue // TypeMapValue map TypeMapValue = 500 )
Define the Type enum
View Source
const ( OriginView = 0 FullView = 1 LiteView = 2 )
View Source
const ( EqualOpr = iota // = NotEqualOpr // != BelowOpr // < AboveOpr // > InOpr // in NotInOpr // !in LikeOpr // like )
Variables ¶
This section is empty.
Functions ¶
func CompareField ¶
func CompareModel ¶
func CompareSpec ¶ added in v1.3.23
func CompareType ¶
func CompareValue ¶
func IsAutoIncrement ¶ added in v1.3.28
func IsAutoIncrement(val ValueDeclare) bool
func IsBasicSlice ¶ added in v1.3.28
func IsBasicType ¶ added in v1.3.28
func IsBasicType(typeValue TypeDeclare) bool
func IsCustomer ¶ added in v1.3.28
func IsCustomer(val ValueDeclare) bool
func IsDateTime ¶ added in v1.3.28
func IsDateTime(val ValueDeclare) bool
func IsDateTimeType ¶ added in v1.3.28
func IsDateTimeType(typeValue TypeDeclare) bool
func IsMapType ¶ added in v1.3.28
func IsMapType(typeVal TypeDeclare) bool
func IsSliceType ¶ added in v1.3.28
func IsSliceType(typeValue TypeDeclare) bool
func IsSnowFlake ¶ added in v1.3.28
func IsSnowFlake(val ValueDeclare) bool
func IsStructSlice ¶ added in v1.3.28
func IsStructType ¶ added in v1.3.28
func IsStructType(typeValue TypeDeclare) bool
func IsUUID ¶ added in v1.3.28
func IsUUID(val ValueDeclare) bool
Types ¶
type Cache ¶
type Cache interface { Reset() Put(name string, vModel Model) Fetch(name string) Model Remove(name string) }
Cache Model Cache
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 any) *cd.Result NotEqual(key string, val any) *cd.Result Below(key string, val any) *cd.Result Above(key string, val any) *cd.Result In(key string, val any) *cd.Result NotIn(key string, val any) *cd.Result Like(key string, val any) *cd.Result Page(page *util.Pagination) Sort(sorter *util.SortFilter) ValueMask(val any) *cd.Result GetFilterItem(key string) FilterItem Pagination() (limit, offset int, paging bool) Sorter() Sorter MaskModel() Model }
Filter orm query filter
type FilterItem ¶
FilterItem FilterItem
type Model ¶
type Model interface { GetName() string GetPkgPath() string GetDescription() string GetPkgKey() string GetFields() Fields SetFieldValue(name string, val Value) SetPrimaryFieldValue(val Value) GetPrimaryField() Field GetField(name string) Field Interface(ptrValue bool, viewSpec ViewDeclare) any Copy(reset bool) Model Dump() string }
type Spec ¶ added in v1.3.23
type Spec interface { IsPrimaryKey() bool GetValueDeclare() ValueDeclare EnableView(ViewDeclare) bool GetDefaultValue() RawVal }
type Type ¶
type Type interface { GetName() string GetPkgPath() string GetDescription() string GetValue() TypeDeclare GetPkgKey() string IsPtrType() bool Interface(initVal any) (Value, *cd.Result) // Elem 获取要素类型(如果非slice,则返回的是本身,如果是slice,则返回slice的elem类型) Elem() Type IsBasic() bool IsStruct() bool IsSlice() bool }
type TypeDeclare ¶ added in v1.3.28
type TypeDeclare int
func (TypeDeclare) IsBasicType ¶ added in v1.3.113
func (s TypeDeclare) IsBasicType() bool
func (TypeDeclare) IsDateTimeType ¶ added in v1.3.113
func (s TypeDeclare) IsDateTimeType() bool
func (TypeDeclare) IsMapType ¶ added in v1.3.113
func (s TypeDeclare) IsMapType() bool
func (TypeDeclare) IsSliceType ¶ added in v1.3.113
func (s TypeDeclare) IsSliceType() bool
func (TypeDeclare) IsStructType ¶ added in v1.3.113
func (s TypeDeclare) IsStructType() bool
func (TypeDeclare) String ¶ added in v1.3.113
func (s TypeDeclare) String() string
type Value ¶
type Value interface { IsValid() bool IsZero() bool Set(val any) Get() any Addr() Value Interface() RawVal IsBasic() bool }
Value Value
type ValueDeclare ¶ added in v1.3.28
type ValueDeclare int
const ( Customer ValueDeclare = iota AutoIncrement UUID SnowFlake DateTime )
func (ValueDeclare) IsAutoIncrement ¶ added in v1.3.113
func (s ValueDeclare) IsAutoIncrement() bool
func (ValueDeclare) IsCustomer ¶ added in v1.3.113
func (s ValueDeclare) IsCustomer() bool
func (ValueDeclare) IsDaeTime ¶ added in v1.3.113
func (s ValueDeclare) IsDaeTime() bool
func (ValueDeclare) IsSnowFlake ¶ added in v1.3.113
func (s ValueDeclare) IsSnowFlake() bool
func (ValueDeclare) IsUUID ¶ added in v1.3.113
func (s ValueDeclare) IsUUID() bool
func (ValueDeclare) String ¶ added in v1.3.28
func (s ValueDeclare) String() string
type ViewDeclare ¶ added in v1.3.90
type ViewDeclare int
func (ViewDeclare) String ¶ added in v1.3.113
func (s ViewDeclare) String() string
Click to show internal directories.
Click to hide internal directories.