Documentation ¶
Index ¶
- Constants
- func GetRegisteredTypeNames() []string
- func GetStructCodingMode() int
- func RegisterType(t reflect.Type)
- func RegisterTypeOf(value any)
- func Serialize(value any, options ...int) []byte
- func SetStructCodingMode(mode int)
- func TurnOffTypeAutoRegistration()
- func TurnOnTypeAutoRegistration()
- func Unserialize(bytes []byte, options ...int) (any, error)
- type Serializable
- type Serializer
- type Unserializer
Constants ¶
View Source
const ( StructCodingModeDefault = 0 StructCodingModeIndex = 1 StructCodingModeName = 2 )
Variables ¶
This section is empty.
Functions ¶
func GetRegisteredTypeNames ¶ added in v1.0.3
func GetRegisteredTypeNames() []string
func GetStructCodingMode ¶ added in v1.0.2
func GetStructCodingMode() int
func RegisterType ¶
func RegisterTypeOf ¶
func RegisterTypeOf(value any)
func SetStructCodingMode ¶ added in v1.0.2
func SetStructCodingMode(mode int)
func TurnOffTypeAutoRegistration ¶
func TurnOffTypeAutoRegistration()
func TurnOnTypeAutoRegistration ¶
func TurnOnTypeAutoRegistration()
Types ¶
type Serializable ¶
type Serializer ¶
type Serializer struct {
// contains filtered or unexported fields
}
func NewSerializer ¶
func NewSerializer(structCodingMode int) *Serializer
func (*Serializer) Encode ¶
func (s *Serializer) Encode(value any) []byte
type Unserializer ¶
type Unserializer struct {
// contains filtered or unexported fields
}
func NewUnserializer ¶
func NewUnserializer(structCodingMode int) *Unserializer
Source Files ¶
Click to show internal directories.
Click to hide internal directories.