Documentation ¶
Index ¶
- func GetSerdeType[T any]() reflect.Type
- func IsTypePtr[T any]() bool
- type ArraySerde
- type BoolSerde
- type Float32Serde
- type Float64Serde
- type Int16Serde
- type Int32Serde
- type Int64Serde
- type Int8Serde
- type IntSerde
- type MapSerde
- type RuneSerde
- type Serde
- type SerdeStub
- type Serializer
- type StreamKeyValueSerde
- type StreamSerde
- type StreamSerializer
- type StringSerde
- type UInt16Serde
- type UInt32Serde
- type UInt64Serde
- type UInt8Serde
- type UIntSerde
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSerdeType ¶
Types ¶
type ArraySerde ¶
type ArraySerde[T any] struct { // contains filtered or unexported fields }
func MakeTypedArraySerde ¶
func MakeTypedArraySerde[T any](valueSerde Serializer) *ArraySerde[T]
func (*ArraySerde[T]) Deserialize ¶
func (s *ArraySerde[T]) Deserialize(data []byte) (T, error)
func (*ArraySerde) DeserializeObj ¶
func (*ArraySerde[T]) Serialize ¶
func (s *ArraySerde[T]) Serialize(value T) ([]byte, error)
func (*ArraySerde) SerializeObj ¶
type BoolSerde ¶
type BoolSerde struct { }
func (*BoolSerde) DeserializeObj ¶
func (*BoolSerde) SerializeObj ¶
type Float32Serde ¶
type Float32Serde struct { }
func (*Float32Serde) Deserialize ¶
func (s *Float32Serde) Deserialize(data []byte) (float32, error)
func (*Float32Serde) DeserializeObj ¶
func (s *Float32Serde) DeserializeObj(data []byte) (interface{}, error)
func (*Float32Serde) SerializeObj ¶
func (s *Float32Serde) SerializeObj(value interface{}) ([]byte, error)
type Float64Serde ¶
type Float64Serde struct { }
func (*Float64Serde) Deserialize ¶
func (s *Float64Serde) Deserialize(data []byte) (float64, error)
func (*Float64Serde) DeserializeObj ¶
func (s *Float64Serde) DeserializeObj(data []byte) (interface{}, error)
func (*Float64Serde) SerializeObj ¶
func (s *Float64Serde) SerializeObj(value interface{}) ([]byte, error)
type Int16Serde ¶
type Int16Serde struct { }
func (*Int16Serde) Deserialize ¶
func (s *Int16Serde) Deserialize(data []byte) (int16, error)
func (*Int16Serde) DeserializeObj ¶
func (s *Int16Serde) DeserializeObj(data []byte) (interface{}, error)
func (*Int16Serde) SerializeObj ¶
func (s *Int16Serde) SerializeObj(value interface{}) ([]byte, error)
type Int32Serde ¶
type Int32Serde struct { }
func (*Int32Serde) Deserialize ¶
func (s *Int32Serde) Deserialize(data []byte) (int32, error)
func (*Int32Serde) DeserializeObj ¶
func (s *Int32Serde) DeserializeObj(data []byte) (interface{}, error)
func (*Int32Serde) SerializeObj ¶
func (s *Int32Serde) SerializeObj(value interface{}) ([]byte, error)
type Int64Serde ¶
type Int64Serde struct { }
func (*Int64Serde) Deserialize ¶
func (s *Int64Serde) Deserialize(data []byte) (int64, error)
func (*Int64Serde) DeserializeObj ¶
func (s *Int64Serde) DeserializeObj(data []byte) (interface{}, error)
func (*Int64Serde) SerializeObj ¶
func (s *Int64Serde) SerializeObj(value interface{}) ([]byte, error)
type Int8Serde ¶
type Int8Serde struct { }
func (*Int8Serde) DeserializeObj ¶
func (*Int8Serde) SerializeObj ¶
type IntSerde ¶
type IntSerde struct { }
func (*IntSerde) DeserializeObj ¶
func (*IntSerde) SerializeObj ¶
type MapSerde ¶
type MapSerde[T any] struct { // contains filtered or unexported fields }
func (*MapSerde[T]) Deserialize ¶
func (*MapSerde) DeserializeObj ¶
func (*MapSerde) SerializeObj ¶
type RuneSerde ¶
type RuneSerde struct { }
func (*RuneSerde) DeserializeObj ¶
func (*RuneSerde) SerializeObj ¶
type Serde ¶
type Serde[T any] interface { Serializer Serialize(T) ([]byte, error) Deserialize([]byte) (T, error) }
func MakeTypedMapSerde ¶
func MakeTypedMapSerde[T any](keySerde Serializer, valueSerde Serializer) Serde[T]
type SerdeStub ¶
type SerdeStub[T any] struct { }
func MakeStubSerde ¶
func (*SerdeStub[T]) Deserialize ¶
func (*SerdeStub[T]) DeserializeObj ¶
func (*SerdeStub[T]) SerializeObj ¶
type Serializer ¶
type Serializer interface { SerializeObj(interface{}) ([]byte, error) DeserializeObj([]byte) (interface{}, error) }
func MakeArraySerde ¶
func MakeArraySerde(arrayType reflect.Type, valueSerde Serializer) Serializer
func MakeDefaultSerde ¶
func MakeDefaultSerde(valueType reflect.Type) (Serializer, error)
func MakeMapSerde ¶
func MakeMapSerde(mapType reflect.Type, keySerde Serializer, valueSerde Serializer) Serializer
type StreamKeyValueSerde ¶
type StreamKeyValueSerde[T any] interface { StreamSerde[T] SerializeKey(T) ([]byte, error) SerializeValue(T) ([]byte, error) KeySerializer() Serializer ValueSerializer() Serializer DeserializeKeyValue([]byte, []byte) (T, error) }
func MakeStreamKeyValueSerde ¶
func MakeStreamKeyValueSerde[K comparable, V any](serdeKey Serde[K], serdeValue Serde[V]) StreamKeyValueSerde[datastruct.KeyValue[K, V]]
type StreamSerde ¶
type StreamSerde[T any] interface { StreamSerializer Serialize(T) ([]byte, error) Deserialize([]byte) (T, error) }
func MakeStreamSerde ¶
func MakeStreamSerde[T any](serde Serde[T]) StreamSerde[T]
type StreamSerializer ¶
type StreamSerializer interface {
IsKeyValue() bool
}
type StringSerde ¶
type StringSerde struct { }
func (*StringSerde) Deserialize ¶
func (s *StringSerde) Deserialize(data []byte) (string, error)
func (*StringSerde) DeserializeObj ¶
func (s *StringSerde) DeserializeObj(data []byte) (interface{}, error)
func (*StringSerde) SerializeObj ¶
func (s *StringSerde) SerializeObj(value interface{}) ([]byte, error)
type UInt16Serde ¶
type UInt16Serde struct { }
func (*UInt16Serde) Deserialize ¶
func (s *UInt16Serde) Deserialize(data []byte) (uint16, error)
func (*UInt16Serde) DeserializeObj ¶
func (s *UInt16Serde) DeserializeObj(data []byte) (interface{}, error)
func (*UInt16Serde) SerializeObj ¶
func (s *UInt16Serde) SerializeObj(value interface{}) ([]byte, error)
type UInt32Serde ¶
type UInt32Serde struct { }
func (*UInt32Serde) Deserialize ¶
func (s *UInt32Serde) Deserialize(data []byte) (uint32, error)
func (*UInt32Serde) DeserializeObj ¶
func (s *UInt32Serde) DeserializeObj(data []byte) (interface{}, error)
func (*UInt32Serde) SerializeObj ¶
func (s *UInt32Serde) SerializeObj(value interface{}) ([]byte, error)
type UInt64Serde ¶
type UInt64Serde struct { }
func (*UInt64Serde) Deserialize ¶
func (s *UInt64Serde) Deserialize(data []byte) (uint64, error)
func (*UInt64Serde) DeserializeObj ¶
func (s *UInt64Serde) DeserializeObj(data []byte) (interface{}, error)
func (*UInt64Serde) SerializeObj ¶
func (s *UInt64Serde) SerializeObj(value interface{}) ([]byte, error)
type UInt8Serde ¶
type UInt8Serde struct { }
func (*UInt8Serde) Deserialize ¶
func (s *UInt8Serde) Deserialize(data []byte) (uint8, error)
func (*UInt8Serde) DeserializeObj ¶
func (s *UInt8Serde) DeserializeObj(data []byte) (interface{}, error)
func (*UInt8Serde) SerializeObj ¶
func (s *UInt8Serde) SerializeObj(value interface{}) ([]byte, error)
type UIntSerde ¶
type UIntSerde struct { }
func (*UIntSerde) DeserializeObj ¶
func (*UIntSerde) SerializeObj ¶
Click to show internal directories.
Click to hide internal directories.