Documentation ¶
Index ¶
- Variables
- func CastVariantReflected(variant Variant, valueRT reflect.Type) (reflect.Value, error)
- type Array
- type Bool
- type Byte
- type Bytes
- type Call
- type CallChain
- type Double
- type Error
- type Float
- type IVariantCreator
- type Int
- type Int16
- type Int32
- type Int64
- type Int8
- type Map
- type Null
- type String
- type TypeId
- type Uint
- type Uint16
- type Uint32
- type Uint64
- type Uint8
- type Value
- type ValueBuff
- type ValueReader
- type ValueWriter
- type Variant
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCast = errors.New("gap: invalid cast") // 类型转换错误 ErrNotDeclared = errors.New("gap: variant not declared") // 类型未注册 )
Functions ¶
Types ¶
type Array ¶
type Array []Variant
Array array
func MakeArrayBuffReadonly ¶ added in v0.1.90
MakeArrayBuffReadonly 创建只读array
func MakeArrayReadonly ¶ added in v0.1.88
MakeArrayReadonly 创建只读array
type CallChain ¶ added in v0.1.69
type CallChain []Call
type IVariantCreator ¶
type IVariantCreator interface { // Declare 注册类型 Declare(v Value) // Undeclare 取消注册类型 Undeclare(typeId TypeId) // New 创建对象指针 New(typeId TypeId) (Value, error) // NewReflected 创建反射对象指针 NewReflected(typeId TypeId) (reflect.Value, error) }
IVariantCreator 可变类型对象构建器接口
type Map ¶
type Map generic.UnorderedSliceMap[Variant, Variant]
Map map
func MakeMapReadonlyFromGoMap ¶ added in v0.1.88
func MakeMapReadonlyFromGoMap[K comparable, V any](m map[K]V) (Map, error)
MakeMapReadonlyFromGoMap 创建只读map
func MakeMapReadonlyFromSliceMap ¶ added in v0.1.88
MakeMapReadonlyFromSliceMap 创建只读map
func MakeMapReadonlyFromUnorderedSliceMap ¶ added in v0.1.88
func MakeMapReadonlyFromUnorderedSliceMap[K comparable, V any](m generic.UnorderedSliceMap[K, V]) (Map, error)
MakeMapReadonlyFromUnorderedSliceMap 创建只读map
func (*Map) ToUnorderedSliceMap ¶ added in v0.1.96
func (v *Map) ToUnorderedSliceMap() *generic.UnorderedSliceMap[Variant, Variant]
ToUnorderedSliceMap 转换为UnorderedSliceMap
type TypeId ¶
type TypeId uint32
TypeId 类型Id
const ( TypeId_None TypeId = iota TypeId_Int TypeId_Int8 TypeId_Int16 TypeId_Int32 TypeId_Int64 TypeId_Uint TypeId_Uint8 TypeId_Uint16 TypeId_Uint32 TypeId_Uint64 TypeId_Float TypeId_Double TypeId_Byte TypeId_Bool TypeId_Bytes TypeId_String TypeId_Null TypeId_Array TypeId_Map TypeId_Error TypeId_CallChain TypeId_Customize = 32 // 自定义类型起点 )
func (TypeId) NewReflected ¶
NewReflected 创建反射对象指针
type ValueBuff ¶ added in v0.1.90
type ValueBuff struct { Type TypeId // 消息Id Buff binaryutil.RecycleBytes // 消息Buff }
ValueBuff value buff
func MakeValueBuff ¶ added in v0.1.90
func MakeValueBuff(v ValueReader) (*ValueBuff, error)
MakeValueBuff 创建ValueBuff
type ValueReader ¶
type ValueReader interface { io.Reader // Size 大小 Size() int // TypeId 类型 TypeId() TypeId // Indirect 原始值 Indirect() any // Release 释放资源 Release() }
ValueReader 读取值
type ValueWriter ¶
ValueWriter 写入值
type Variant ¶
type Variant struct { TypeId TypeId // 类型Id ValueReadonly ValueReader // 只读值 Value Value // 值 Reflected reflect.Value // 反射值 }
Variant 可变类型
func CastVariantReadonly ¶ added in v0.1.88
CastVariantReadonly 转换只读可变类型
func MakeVariantReadonly ¶ added in v0.1.88
func MakeVariantReadonly(v ValueReader) (Variant, error)
MakeVariantReadonly 创建只读可变类型
Source Files ¶
- typeid.go
- typeid_builtin.go
- value.go
- value_builtin_array.go
- value_builtin_array_readonly.go
- value_builtin_bool.go
- value_builtin_byte.go
- value_builtin_bytes.go
- value_builtin_callchain.go
- value_builtin_double.go
- value_builtin_error.go
- value_builtin_float.go
- value_builtin_int.go
- value_builtin_int16.go
- value_builtin_int32.go
- value_builtin_int64.go
- value_builtin_int8.go
- value_builtin_map.go
- value_builtin_map_readonly.go
- value_builtin_null.go
- value_builtin_string.go
- value_builtin_uint.go
- value_builtin_uint16.go
- value_builtin_uint32.go
- value_builtin_uint64.go
- value_builtin_uint8.go
- valuebuff.go
- variant.go
- variant_cast.go
- variant_readonly.go
- variant_readonly_cast.go
- variantcreator.go
Click to show internal directories.
Click to hide internal directories.