Versions in this module Expand all Collapse all v0 v0.12.2 Mar 18, 2021 Changes in this version + const MaxRecordSize + var ErrRecordTooLarge = errors.New("record is too large") + var ErrStreamNotCanonical = errors.New("tlv stream is not canonical") + var ErrTUintNotMinimal = errors.New("truncated uint not minimally encoded") + var ErrVarIntNotCanonical = errors.New("decoded varint is not canonical") + func DBytes32(r io.Reader, val interface{}, _ *[8]byte, l uint64) error + func DBytes33(r io.Reader, val interface{}, _ *[8]byte, l uint64) error + func DBytes64(r io.Reader, val interface{}, _ *[8]byte, l uint64) error + func DNOP(io.Reader, interface{}, *[8]byte, uint64) error + func DPubKey(r io.Reader, val interface{}, _ *[8]byte, l uint64) error + func DTUint16(r io.Reader, val interface{}, buf *[8]byte, l uint64) error + func DTUint32(r io.Reader, val interface{}, buf *[8]byte, l uint64) error + func DTUint64(r io.Reader, val interface{}, buf *[8]byte, l uint64) error + func DUint16(r io.Reader, val interface{}, buf *[8]byte, l uint64) error + func DUint32(r io.Reader, val interface{}, buf *[8]byte, l uint64) error + func DUint64(r io.Reader, val interface{}, buf *[8]byte, l uint64) error + func DUint8(r io.Reader, val interface{}, buf *[8]byte, l uint64) error + func DVarBytes(r io.Reader, val interface{}, _ *[8]byte, l uint64) error + func EBytes32(w io.Writer, val interface{}, _ *[8]byte) error + func EBytes33(w io.Writer, val interface{}, _ *[8]byte) error + func EBytes64(w io.Writer, val interface{}, _ *[8]byte) error + func ENOP(io.Writer, interface{}, *[8]byte) error + func EPubKey(w io.Writer, val interface{}, _ *[8]byte) error + func ETUint16(w io.Writer, val interface{}, buf *[8]byte) error + func ETUint16T(w io.Writer, val uint16, buf *[8]byte) error + func ETUint32(w io.Writer, val interface{}, buf *[8]byte) error + func ETUint32T(w io.Writer, val uint32, buf *[8]byte) error + func ETUint64(w io.Writer, val interface{}, buf *[8]byte) error + func ETUint64T(w io.Writer, val uint64, buf *[8]byte) error + func EUint16(w io.Writer, val interface{}, buf *[8]byte) error + func EUint16T(w io.Writer, val uint16, buf *[8]byte) error + func EUint32(w io.Writer, val interface{}, buf *[8]byte) error + func EUint32T(w io.Writer, val uint32, buf *[8]byte) error + func EUint64(w io.Writer, val interface{}, buf *[8]byte) error + func EUint64T(w io.Writer, val uint64, buf *[8]byte) error + func EUint8(w io.Writer, val interface{}, buf *[8]byte) error + func EUint8T(w io.Writer, val uint8, buf *[8]byte) error + func EVarBytes(w io.Writer, val interface{}, _ *[8]byte) error + func ReadVarInt(r io.Reader, buf *[8]byte) (uint64, error) + func RecordsToMap(records []Record) (map[uint64][]byte, error) + func SizeTUint16(v uint16) uint64 + func SizeTUint32(v uint32) uint64 + func SizeTUint64(v uint64) uint64 + func SortRecords(records []Record) + func VarIntSize(val uint64) uint64 + func WriteVarInt(w io.Writer, val uint64, buf *[8]byte) error + type Decoder func(r io.Reader, val interface{}, buf *[8]byte, l uint64) error + type Encoder func(w io.Writer, val interface{}, buf *[8]byte) error + func StubEncoder(v []byte) Encoder + type ErrTypeForDecoding struct + func NewTypeForDecodingErr(val interface{}, expType string, valLength, expLength uint64) ErrTypeForDecoding + func (e ErrTypeForDecoding) Error() string + type ErrTypeForEncoding struct + func NewTypeForEncodingErr(val interface{}, expType string) ErrTypeForEncoding + func (e ErrTypeForEncoding) Error() string + type Record struct + func MakeDynamicRecord(typ Type, val interface{}, sizeFunc SizeFunc, encoder Encoder, decoder Decoder) Record + func MakePrimitiveRecord(typ Type, val interface{}) Record + func MakeStaticRecord(typ Type, val interface{}, size uint64, encoder Encoder, decoder Decoder) Record + func MapToRecords(tlvMap map[uint64][]byte) []Record + func (f *Record) Decode(r io.Reader, l uint64) error + func (f *Record) Encode(w io.Writer) error + func (f *Record) Size() uint64 + func (f *Record) Type() Type + type RecordProducer interface + Record func() Record + type SizeFunc func() uint64 + func SizeVarBytes(e *[]byte) SizeFunc + type Stream struct + func MustNewStream(records ...Record) *Stream + func NewStream(records ...Record) (*Stream, error) + func (s *Stream) Decode(r io.Reader) error + func (s *Stream) DecodeWithParsedTypes(r io.Reader) (TypeMap, error) + func (s *Stream) Encode(w io.Writer) error + type Type uint64 + type TypeMap map[Type][]byte