Documentation
¶
Index ¶
- func FindChildValueReflect(parent reflect.Value, keySeqs []string) (reflect.Value, bool)
- func SetChildValueReflect(parent reflect.Value, keySeqs []string, value interface{}) ([]string, error)
- func SetValueReflect(refValue reflect.Value, value interface{}) error
- type IncrRecords
- type Packer
- type ReflectTable
- type Serializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindChildValueReflect ¶
FindChildValueReflect 通过反射方法在 parent 结构中查找 keySeqs 指定的子节点字段的反射值。 parent 必须是 map 或者 struct
func SetChildValueReflect ¶
func SetChildValueReflect(parent reflect.Value, keySeqs []string, value interface{}) ([]string, error)
SetChildValueReflect 通过反射方法在 parent 的结构中设置其 keySeqs 指定的子节点的值
func SetValueReflect ¶
SetValueReflect 通过反射的方法对一个字段进行赋值
Types ¶
type IncrRecords ¶
type IncrRecords struct {
// contains filtered or unexported fields
}
IncrRecords 数据增量记录表 用于存储一个文档型数据结构中的字段级增量标记,包括对每个字段的更新和删除的增量版本号
type Packer ¶
type Packer struct {
// contains filtered or unexported fields
}
Packer 脏数据打包器,与一个数据实体是绑定关系
func NewPacker ¶
func NewPacker(data interface{}, f Serializer) (*Packer, error)
NewPacker Packer 构造函数,传入数据实体,生成与其绑定的打包器
type ReflectTable ¶
type ReflectTable struct {
// contains filtered or unexported fields
}
ReflectTable 数据实体的固定字段全反射表 用于在使用反射方法通过字段名 读取|写入 字段数据时,可以快速定位到字段变量的反射值,不需要再重新反射查找
func NewReflectTable ¶
func NewReflectTable(root reflect.Value) *ReflectTable
NewReflectTable 构造一个数据实体的固定字段全反射表
func (*ReflectTable) FindParentOf ¶
func (rt *ReflectTable) FindParentOf(key string) (reflect.Value, []string)
FindParentOf 在固定字段全反射表中找到 key 对应字段所属的父节点的反射值, 及其在父节点下的 subkey
Click to show internal directories.
Click to hide internal directories.