# Functions
DBigSize decodes an uint32 or an uint64 using BigSize format.
DBool decodes a boolean.
DBytes32 is a Decoder for 32-byte arrays.
DBytes33 is a Decoder for 33-byte arrays.
DBytes64 is an Decoder for 64-byte arrays.
DNOP is an encoder that doesn't modify the io.Reader and never fails.
DPubKey is a Decoder for *btcec.PublicKey values.
DTUint16 is an Decoder for truncated uint16 values, where leading zeros will be resurrected.
DTUint32 is an Decoder for truncated uint32 values, where leading zeros will be resurrected.
DTUint64 is an Decoder for truncated uint64 values, where leading zeros will be resurrected.
DUint16 is a Decoder for uint16 values.
DUint32 is a Decoder for uint32 values.
DUint64 is a Decoder for uint64 values.
DUint8 is a Decoder for uint8 values.
DVarBytes is a Decoder for variable byte slices.
EBigSize encodes an uint32 or an uint64 using BigSize format.
EBool encodes a boolean.
EBoolT encodes a bool val to the provided io.Writer.
EBytes32 is an Encoder for 32-byte arrays.
EBytes33 is an Encoder for 33-byte arrays.
EBytes64 is an Encoder for 64-byte arrays.
ENOP is an encoder that doesn't modify the io.Writer and never fails.
EPubKey is an Encoder for *btcec.PublicKey values.
ETUint16 is an Encoder for truncated uint16 values, where leading zeros will be omitted.
ETUint16T is an Encoder for truncated uint16 values, where leading zeros will be omitted.
ETUint32 is an Encoder for truncated uint32 values, where leading zeros will be omitted.
ETUint32T is an Encoder for truncated uint32 values, where leading zeros will be omitted.
ETUint64 is an Encoder for truncated uint64 values, where leading zeros will be omitted.
ETUint64T is an Encoder for truncated uint64 values, where leading zeros will be omitted.
EUint16 is an Encoder for uint16 values.
EUint16T encodes a uint16 val to the provided io.Writer.
EUint32 is an Encoder for uint32 values.
EUint32T encodes a uint32 val to the provided io.Writer.
EUint64 is an Encoder for uint64 values.
EUint64T encodes a uint64 val to the provided io.Writer.
EUint8 is an Encoder for uint8 values.
EUint8T encodes a uint8 val to the provided io.Writer.
EVarBytes is an Encoder for variable byte slices.
MakeBigSizeRecord creates a tlv record using the BigSize format.
MakeDynamicRecord creates a record whose size may vary, and will be determined at the time of encoding via sizeFunc.
MakePrimitiveRecord creates a record for common types.
MakeStaticRecord creates a record for a field of fixed-size.
MapToRecords encodes the passed TLV map as a series of regular tlv.Record instances.
MustNewStream creates a new TLV Stream given an encoding codec, a decoding codec, and a set of known records.
NewBigSizeT creates a new BigSizeT type from a given integer type.
NewPrimitiveRecord creates a new RecordT type from a given primitive type.
NewRecordT creates a new RecordT type from a given RecordProducer type.
NewStream creates a new TLV Stream given an encoding codec, a decoding codec, and a set of known records.
NewTypeForDecodingErr creates a new ErrTypeForDecoding given the incorrect val and expected type, or the mismatch in their expected lengths.
NewTypeForEncodingErr creates a new ErrTypeForEncoding given the incorrect val and the expected type.
ReadVarInt reads a variable length integer from r and returns it as a uint64.
RecordsToMap encodes a series of TLV records as raw key-value pairs in the form of a map.
SizeBigSize returns a SizeFunc that can compute the length of BigSize.
SizeTUint16 returns the number of bytes remaining in a uint16 after truncating the leading zeros.
SizeTUint32 returns the number of bytes remaining in a uint32 after truncating the leading zeros.
SizeTUint64 returns the number of bytes remaining in a uint64 after truncating the leading zeros.
SizeVarBytes returns a SizeFunc that can compute the length of a byte slice.
SomeRecordT creates a new OptionalRecordT type from a given RecordT type.
SortRecords is a helper function that will sort a slice of records in place according to their type.
StubEncoder is a factory function that makes a stub tlv.Encoder out of a raw value.
VarIntSize returns the required number of bytes to encode a var int.
WriteVarInt serializes val to w using a variable number of bytes depending on its value.
ZeroRecordT returns a zero value of the RecordT type.
# Constants
65KB.
# Variables
ErrRecordTooLarge signals that a decoded record has a length that is too long to parse.
ErrStreamNotCanonical signals that a decoded stream does not contain records sorting by monotonically-increasing type.
ErrTUintNotMinimal signals that decoding a truncated uint failed because the value was not minimally encoded.
ErrVarIntNotCanonical signals that the decoded varint was not minimally encoded.
# Structs
BigSizeT is a high-order type that represents a TLV record that encodes an integer as a BigSize value in the stream.
ErrTypeForDecoding signals that an incorrect type was passed to a Decoder or that the expected length of the encoding is different from that required by the expected type.
ErrTypeForEncoding signals that an incorrect type was passed to an Encoder.
OptionalRecordT is a high-order type that represents an optional TLV record.
Record holds the required information to encode or decode a TLV record.
RecordT is a high-order type makes it easy to encode known "primitive" types as TLV records.
Stream defines a TLV stream that can be used for encoding or decoding a set of TLV Records.
# Interfaces
Primitive is a type constraint that capture the set of "primitive" types, which are the built in stdlib types, and type defs of those types.
RecorderProducer is an interface for objects that can produce a Record object capable of encoding and/or decoding the RecordProducer as a Record.
RecordProducerT is a type-aware wrapper around the normal RecordProducer interface.
TlvType is an interface used to enable binding the integer type of a TLV record to the type at compile time.
# Type aliases
Blob is a type alias for a byte slice.
Decoder is a signature for methods that can decode TLV values.
Encoder is a signature for methods that can encode TLV values.
SizeFunc is a function that can compute the length of a given field.
Type is an 64-bit identifier for a TLV Record.
TypeMap is a map of parsed Types.