remote

package
v1.3.67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NameTag    = "name"
	PkgPathTag = "pkgPath"
	FieldsTag  = "fields"
	ValuesTag  = "values"
	ValueTag   = "value"
)

Variables

View Source
var NilValue = ValueImpl{}

Functions

func AppendSliceValue

func AppendSliceValue(sliceVal model.Value, vVal model.Value) (ret model.Value, err error)

func CompareObject added in v1.3.28

func CompareObject(l, r *Object) bool

func CompareObjectValue

func CompareObjectValue(l, r *ObjectValue) bool

func CompareSliceObjectValue added in v1.3.28

func CompareSliceObjectValue(l, r *SliceObjectValue) bool

func DecodeValue

func DecodeValue(tVal interface{}, tType model.Type, mCache model.Cache) (ret model.Value, err error)

func ElemDependValue

func ElemDependValue(vVal model.Value) (ret []model.Value, err error)

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 EncodeValue(tVal model.Value, tType model.Type, mCache model.Cache) (ret interface{}, err error)

func GetEntityModel

func GetEntityModel(entity interface{}) (ret model.Model, err error)

func GetEntityType

func GetEntityType(entity interface{}) (ret model.Type, err error)

func GetEntityValue

func GetEntityValue(entity interface{}) (ret model.Value, err error)

func GetModelFilter added in v1.3.4

func GetModelFilter(vModel model.Model) (ret model.Filter, err error)

func GetValue added in v1.3.28

func GetValue(valueDeclare model.ValueDeclare) (ret model.Value)

func SetModelValue

func SetModelValue(vModel model.Model, vVal model.Value) (ret model.Model, err error)

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 (s *Field) GetDescription() string

func (*Field) GetName added in v1.3.4

func (s *Field) GetName() string

func (*Field) GetSpec added in v1.3.23

func (s *Field) GetSpec() (ret model.Spec)

func (*Field) GetType added in v1.3.4

func (s *Field) GetType() (ret model.Type)

func (*Field) GetValue added in v1.3.4

func (s *Field) GetValue() (ret model.Value)

func (*Field) IsBasic added in v1.3.44

func (s *Field) IsBasic() bool

func (*Field) IsPrimaryKey added in v1.3.28

func (s *Field) IsPrimaryKey() bool

func (*Field) IsPtrType added in v1.3.44

func (s *Field) IsPtrType() bool

func (*Field) IsSlice added in v1.3.44

func (s *Field) IsSlice() bool

func (*Field) IsStruct added in v1.3.44

func (s *Field) IsStruct() bool

func (*Field) SetValue added in v1.3.4

func (s *Field) SetValue(val model.Value)

type FieldValue added in v1.3.4

type FieldValue struct {
	Name  string `json:"name"`
	Value any    `json:"value"`
}

func ConvertItem

func ConvertItem(val *FieldValue) (ret *FieldValue, err error)

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) Copy

func (s *Object) Copy(reset bool) (ret model.Model)

func (*Object) Dump

func (s *Object) Dump() (ret string)

func (*Object) GetDescription added in v1.3.28

func (s *Object) GetDescription() (ret string)

func (*Object) GetField

func (s *Object) GetField(name string) (ret model.Field)

func (*Object) GetFields

func (s *Object) GetFields() (ret model.Fields)

func (*Object) GetName

func (s *Object) GetName() (ret string)

func (*Object) GetPkgKey added in v1.3.0

func (s *Object) GetPkgKey() string

func (*Object) GetPkgPath

func (s *Object) GetPkgPath() (ret string)

func (*Object) GetPrimaryField

func (s *Object) GetPrimaryField() (ret model.Field)

func (*Object) Interface

func (s *Object) Interface(_ bool) (ret any)

Interface object value

func (*Object) SetFieldValue

func (s *Object) SetFieldValue(name string, val model.Value) (err error)

func (*Object) Verify added in v1.3.17

func (s *Object) Verify() (err error)

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) model.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 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() model.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() model.Sorter

func (*ObjectFilter) ValueMask added in v1.3.3

func (s *ObjectFilter) ValueMask(val interface{}) (err error)

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 error)

ConvertObjectValue convert object value

func DecodeObjectValue

func DecodeObjectValue(data []byte) (ret *ObjectValue, err error)

DecodeObjectValue decode objectValue

func (*ObjectValue) Copy added in v1.3.28

func (s *ObjectValue) Copy() (ret *ObjectValue)

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 interface{})

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 error)

func DecodeSliceObjectValue

func DecodeSliceObjectValue(data []byte) (ret *SliceObjectValue, err error)

DecodeSliceObjectValue decode objectValue

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"`
}

func (SpecImpl) GetFieldName added in v1.3.23

func (s SpecImpl) GetFieldName() string

func (SpecImpl) GetValueDeclare added in v1.3.28

func (s SpecImpl) GetValueDeclare() model.ValueDeclare

func (SpecImpl) IsPrimaryKey added in v1.3.23

func (s SpecImpl) IsPrimaryKey() bool

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) Elem

func (s *TypeImpl) Elem() model.Type

Elem get element type

func (*TypeImpl) GetDescription added in v1.3.28

func (s *TypeImpl) GetDescription() (ret string)

func (*TypeImpl) GetName

func (s *TypeImpl) GetName() (ret string)

func (*TypeImpl) GetPkgKey added in v1.3.0

func (s *TypeImpl) GetPkgKey() string

func (*TypeImpl) GetPkgPath

func (s *TypeImpl) GetPkgPath() (ret string)

func (*TypeImpl) GetValue

func (s *TypeImpl) GetValue() (ret model.TypeDeclare)

func (*TypeImpl) Interface

func (s *TypeImpl) Interface(initVal any) (ret model.Value, err error)

func (*TypeImpl) IsBasic

func (s *TypeImpl) IsBasic() bool

func (*TypeImpl) IsPtrType

func (s *TypeImpl) IsPtrType() (ret bool)

func (*TypeImpl) IsSlice added in v1.3.44

func (s *TypeImpl) IsSlice() bool

func (*TypeImpl) IsStruct added in v1.3.44

func (s *TypeImpl) IsStruct() bool

type ValueImpl

type ValueImpl struct {
	// contains filtered or unexported fields
}

func NewValue added in v1.3.28

func NewValue(val any) (ret *ValueImpl)

func (*ValueImpl) Addr

func (s *ValueImpl) Addr() model.Value

func (*ValueImpl) Copy added in v1.3.28

func (s *ValueImpl) Copy() (ret *ValueImpl)

func (*ValueImpl) Get

func (s *ValueImpl) Get() any

func (*ValueImpl) Interface added in v1.3.28

func (s *ValueImpl) Interface() any

func (*ValueImpl) IsBasic added in v1.2.0

func (s *ValueImpl) IsBasic() bool

func (*ValueImpl) IsNil

func (s *ValueImpl) IsNil() (ret bool)

func (*ValueImpl) IsZero added in v1.3.28

func (s *ValueImpl) IsZero() (ret bool)

func (*ValueImpl) Set

func (s *ValueImpl) Set(val any)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL