Documentation
¶
Index ¶
- Constants
- Variables
- func BytesSerializedLength(val []byte) int
- func StringSerializedLength(val string) int
- type BoolFromBytesDecoder
- type BoolToBytesEncoder
- type BytesToBytesEncoder
- type FromBytes
- type Option
- type OptionFromBytesDecoder
- type SliceFromBytesDecoder
- type SliceToBytesEncoder
- type StringFromBytesDecoder
- type StringToBytesEncoder
- type ToBytes
- type U16FromBytesDecoder
- type U32FromBytesDecoder
- type U32ToBytesEncoder
- type U64FromBytesDecoder
- type U64ToBytesEncoder
- type U8FromBytesDecoder
Constants ¶
View Source
const ( OptionNoneTag byte = 0 OptionSomeTag byte = 1 )
View Source
const BoolSerializedLength = 1
View Source
const U16SerializedLength = 2
View Source
const U32SerializedLength = 4
View Source
const U64SerializedLength = 8
View Source
const U8SerializedLength = 1
Variables ¶
View Source
var ( ErrEmptyBytesSource = errors.New("empty bytes source") ErrInvalidBytesStructure = errors.New("invalid bytes structure") )
Functions ¶
func BytesSerializedLength ¶
func StringSerializedLength ¶
Types ¶
type BoolFromBytesDecoder ¶
type BoolFromBytesDecoder struct{}
func NewBoolFromBytesDecoder ¶
func NewBoolFromBytesDecoder() *BoolFromBytesDecoder
type BoolToBytesEncoder ¶
type BoolToBytesEncoder struct {
// contains filtered or unexported fields
}
func NewBoolToBytesEncoder ¶
func NewBoolToBytesEncoder(val bool) BoolToBytesEncoder
func (BoolToBytesEncoder) Bytes ¶
func (enc BoolToBytesEncoder) Bytes() ([]byte, error)
type BytesToBytesEncoder ¶
type BytesToBytesEncoder struct {
// contains filtered or unexported fields
}
func NewBytesToBytesEncoder ¶
func NewBytesToBytesEncoder(val []byte) BytesToBytesEncoder
func (BytesToBytesEncoder) Bytes ¶
func (enc BytesToBytesEncoder) Bytes() ([]byte, error)
type OptionFromBytesDecoder ¶
type SliceFromBytesDecoder ¶
type SliceToBytesEncoder ¶
type SliceToBytesEncoder[E ToBytes] struct { // contains filtered or unexported fields }
func NewSliceToBytesEncoder ¶
func NewSliceToBytesEncoder[E ToBytes](values []E) *SliceToBytesEncoder[E]
func (*SliceToBytesEncoder[E]) Bytes ¶
func (enc *SliceToBytesEncoder[E]) Bytes() ([]byte, error)
type StringFromBytesDecoder ¶
type StringFromBytesDecoder struct{}
type StringToBytesEncoder ¶
type StringToBytesEncoder struct {
// contains filtered or unexported fields
}
func NewStringToBytesEncoder ¶
func NewStringToBytesEncoder(val string) StringToBytesEncoder
func (StringToBytesEncoder) Bytes ¶
func (enc StringToBytesEncoder) Bytes() ([]byte, error)
type U16FromBytesDecoder ¶
type U16FromBytesDecoder struct{}
type U32FromBytesDecoder ¶
type U32FromBytesDecoder struct{}
func NewU32FromBytesDecoder ¶
func NewU32FromBytesDecoder() *U32FromBytesDecoder
type U32ToBytesEncoder ¶
type U32ToBytesEncoder struct {
// contains filtered or unexported fields
}
func NewU32ToBytesEncoder ¶
func NewU32ToBytesEncoder(val uint32) U32ToBytesEncoder
func (U32ToBytesEncoder) Bytes ¶
func (enc U32ToBytesEncoder) Bytes() ([]byte, error)
type U64FromBytesDecoder ¶
type U64FromBytesDecoder struct{}
type U64ToBytesEncoder ¶
type U64ToBytesEncoder struct {
// contains filtered or unexported fields
}
func NewU64ToBytesEncoder ¶
func NewU64ToBytesEncoder(val uint64) U64ToBytesEncoder
func (U64ToBytesEncoder) Bytes ¶
func (enc U64ToBytesEncoder) Bytes() ([]byte, error)
type U8FromBytesDecoder ¶
type U8FromBytesDecoder struct{}
Click to show internal directories.
Click to hide internal directories.