Documentation ¶
Index ¶
- func ParseKey(key string) (className, id string)
- type IObject
- type IRoot
- type Object
- func (s *Object) RefArray(field string) datax.A
- func (s *Object) RefBool(field string) bool
- func (s *Object) RefClass(field string) IObject
- func (s *Object) RefClassCreator(field string, creator func(object IObject) IObject)
- func (s *Object) RefData() datax.M
- func (s *Object) RefFieldChanged() bool
- func (s *Object) RefFieldPath() string
- func (s *Object) RefFloat64(field string) float64
- func (s *Object) RefGet(field string) (val interface{})
- func (s *Object) RefHas(field string) bool
- func (s *Object) RefInt(field string) int
- func (s *Object) RefIsNil() bool
- func (s *Object) RefKeys() (r []string)
- func (s *Object) RefLength() int
- func (s *Object) RefMap(field string) (r IObject)
- func (s *Object) RefNew() IObject
- func (s *Object) RefNewIfNil() IObject
- func (s *Object) RefRemove(field string)
- func (s *Object) RefRemoveFromRoot()
- func (s *Object) RefReset(data map[string]interface{})
- func (s *Object) RefSet(field string, val interface{})
- func (s *Object) RefSetNil()
- func (s *Object) RefString(field string) string
- func (s *Object) RefUint(field string) uint
- func (s *Object) RefUpdate(data map[string]interface{})
- func (s *Object) ToMap() (r datax.M)
- func (s *Object) ToMapByField(fieldMap datax.M) (r datax.M)
- func (s *Object) ToMapVersion() (r datax.M)
- type Root
- type RootMap
- type Source
- func (s *Source) Clone() (r *Source)
- func (s *Source) Dispose()
- func (s *Source) KeyVersionNew(parents []string, path string)
- func (s *Source) KeyVersionReset()
- func (s *Source) RefIsRemove() bool
- func (s *Source) RefLastVersion() int
- func (s *Source) RefRemove()
- func (s *Source) RefReset(val map[string]interface{})
- func (s *Source) RefVersionComplete()
- func (s *Source) RefVersions() (r map[string]int)
- func (s *Source) WithVersion() *Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IObject ¶
type IObject interface { RefGet(field string) (val interface{}) RefSet(field string, val interface{}) // 字段的路径 RefFieldPath() string // RefFieldChanged() bool RefHas(field string) (val bool) // basic RefInt(field string) (val int) RefFloat64(field string) (val float64) RefString(field string) (val string) RefBool(field string) (val bool) RefArray(field string) datax.A RefMap(field string) IObject // object RefClass(field string) IObject RefClassCreator(field string, creator func(object IObject) IObject) RefLastVersion() int RefVersions() map[string]int RefVersionComplete() KeyVersionReset() // 设置为nil RefSetNil() RefNew() IObject RefNewIfNil() IObject RefIsNil() bool RefKeys() []string RefData() datax.M RefLength() int RefReset(val map[string]interface{}) RefUpdate(data map[string]interface{}) RefRemove(field string) //FromMap(m datax.M) //fromMap(m datax.M) ToMapVersion() (r datax.M) ToMap() (r datax.M) ToMapByField(fieldMap datax.M) (r datax.M) // contains filtered or unexported methods }
type IRoot ¶
type IRoot interface { IObject // 获取编号 // field="_id" RefId() string RefIdSet(val string) RefClone() (r *Root) RefIsRemove() bool RefDispose() RefOnChange(func(path, field string, val interface{})) RefReset(val map[string]interface{}) }
根
type Object ¶
type Object struct { *Source // contains filtered or unexported fields }
func (*Object) RefClassCreator ¶
func (*Object) RefFloat64 ¶
func (*Object) RefRemoveFromRoot ¶
func (s *Object) RefRemoveFromRoot()
把对象脱离与Root的关联,自己独立成Root,可以避免运行时对Root产生影响
type Root ¶
type Root struct {
*Object
}
根
func (*Root) RefDispose ¶
func (s *Root) RefDispose()
func (*Root) RefOnChange ¶
type RootMap ¶
RootMap只用于管理Root, 便于coder进行处理
func (RootMap) DisposeAll ¶
func (m RootMap) DisposeAll()
func (RootMap) DisposeRemoved ¶
func (m RootMap) DisposeRemoved()
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func NewSourceWith ¶
func (*Source) KeyVersionNew ¶
增加字段的版本
func (*Source) RefIsRemove ¶
func (*Source) WithVersion ¶
Click to show internal directories.
Click to hide internal directories.