Documentation
¶
Index ¶
- Variables
- func ByteSliceToString(b []byte) string
- func DecodeBool(buffer *bytes.Buffer) bool
- func DecodeBuffer(buffer *bytes.Buffer) *bytes.Buffer
- func DecodeBytes(buffer *bytes.Buffer) []byte
- func DecodeDecodable(decodable Decodable, buffer *bytes.Buffer) any
- func DecodeFloat32(buffer *bytes.Buffer) float32
- func DecodeFloat64(buffer *bytes.Buffer) float64
- func DecodeInt(buffer *bytes.Buffer) int
- func DecodeInt8(buffer *bytes.Buffer) int8
- func DecodeInt16(buffer *bytes.Buffer) int16
- func DecodeInt32(buffer *bytes.Buffer) int32
- func DecodeInt64(buffer *bytes.Buffer) int64
- func DecodeString(buffer *bytes.Buffer) string
- func DecodeUint8(buffer *bytes.Buffer) uint8
- func DecodeUint16(buffer *bytes.Buffer) uint16
- func DecodeUint32(buffer *bytes.Buffer) uint32
- func DecodeUint64(buffer *bytes.Buffer) uint64
- func EncodeBool(v bool, buffer *bytes.Buffer)
- func EncodeBuffer(v *bytes.Buffer, buffer *bytes.Buffer)
- func EncodeBytes(v []byte, buffer *bytes.Buffer)
- func EncodeEncodeable(v Encodeable, buffer *bytes.Buffer)
- func EncodeFloat32(v float32, buffer *bytes.Buffer)
- func EncodeFloat64(v float64, buffer *bytes.Buffer)
- func EncodeInt(v int, buffer *bytes.Buffer)
- func EncodeInt8(v int8, buffer *bytes.Buffer)
- func EncodeInt16(v int16, buffer *bytes.Buffer)
- func EncodeInt32(v int32, buffer *bytes.Buffer)
- func EncodeInt64(v int64, buffer *bytes.Buffer)
- func EncodeString(v string, buffer *bytes.Buffer)
- func EncodeUint8(v uint8, buffer *bytes.Buffer)
- func EncodeUint16(v uint16, buffer *bytes.Buffer)
- func EncodeUint32(v uint32, buffer *bytes.Buffer)
- func EncodeUint64(v uint64, buffer *bytes.Buffer)
- type BinaryDecoder
- type BinaryEncoder
- type Decodable
- type Encodeable
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWrongEncodeType = errors.New("error wrong encode type") ErrWrongDecodeType = errors.New("error wrong decode type") )
All kind of errors
Functions ¶
func ByteSliceToString ¶
ByteSliceToString cast given bytes to string, without allocation memory
func DecodeBuffer ¶
DecodeBuffer decode to buffer
func DecodeDecodable ¶
DecodeDecodable decode specific structure
func DecodeFloat32 ¶
DecodeFloat32 decode to float32
func DecodeFloat64 ¶
DecodeFloat64 decode to float64
func EncodeBuffer ¶
EncodeBuffer encode buffer
func EncodeEncodeable ¶
func EncodeEncodeable(v Encodeable, buffer *bytes.Buffer)
EncodeEncodeable encode Encodeable
func EncodeFloat32 ¶
EncodeFloat32 encode float32
func EncodeFloat64 ¶
EncodeFloat64 encode float64
Types ¶
type BinaryDecoder ¶
type BinaryDecoder struct {
// contains filtered or unexported fields
}
BinaryDecoder contains buffer and convert binary to value
func NewBinaryDecoder ¶
func NewBinaryDecoder(data []byte) *BinaryDecoder
NewBinaryDecoder return new decoder
func (*BinaryDecoder) Decode ¶
func (b *BinaryDecoder) Decode(value any) error
Decode read value to bytes
type BinaryEncoder ¶
type BinaryEncoder struct {
// contains filtered or unexported fields
}
BinaryEncoder contains buffer and convert values to binary
func (*BinaryEncoder) Encode ¶
func (b *BinaryEncoder) Encode(value any) error
Encode add value to bytes
type Encodeable ¶
Encodeable describe encodeable interface
Click to show internal directories.
Click to hide internal directories.