Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
 - type Array
 - type Bool
 - type Byte
 - type Bytes
 - type Double
 - type Error
 - type Float
 - type IVariantCreator
 - type Int
 - type Int16
 - type Int32
 - type Int64
 - type Int8
 - type KV
 - type Map
 - type Null
 - type String
 - type TypeId
 - type Uint
 - type Uint16
 - type Uint32
 - type Uint64
 - type Uint8
 - type Value
 - type ValueReader
 - type ValueWriter
 - type Variant
 
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
var ( ErrNotVariant = errors.New("gap: not variant") // 非可变类型 ErrNotDeclared = errors.New("gap: variant not declared") // 类型未注册 )
Functions ¶
This section is empty.
Types ¶
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 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_Customize = 32 // 自定义类型起点 )
func (TypeId) NewReflected ¶
NewReflected 创建反射对象指针
type ValueReader ¶
type ValueReader interface {
	io.Reader
	// Size 大小
	Size() int
	// TypeId 类型
	TypeId() TypeId
	// Indirect 原始值
	Indirect() any
}
    ValueReader 读取值
type ValueWriter ¶
ValueWriter 写入值
      
      Source Files
      ¶
    
- typeid.go
 - typeid_builtin.go
 - value.go
 - value_builtin_array.go
 - value_builtin_bool.go
 - value_builtin_byte.go
 - value_builtin_bytes.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_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
 - variant.go
 - variantcreator.go
 
 Click to show internal directories. 
   Click to hide internal directories.