tlv

package module
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 13 Imported by: 71

Documentation

Index

Constants

View Source
const MaxRecordSize = 65535 // 65KB

MaxRecordSize is the maximum size of a particular record that will be parsed by a stream decoder. This value is currently chosen to the be equal to the maximum message size permitted by BOLT 1, as no record should be bigger than an entire message.

Variables

View Source
var ErrRecordTooLarge = errors.New("record is too large")

ErrRecordTooLarge signals that a decoded record has a length that is too long to parse.

View Source
var ErrStreamNotCanonical = errors.New("tlv stream is not canonical")

ErrStreamNotCanonical signals that a decoded stream does not contain records sorting by monotonically-increasing type.

View Source
var ErrTUintNotMinimal = errors.New("truncated uint not minimally encoded")

ErrTUintNotMinimal signals that decoding a truncated uint failed because the value was not minimally encoded.

View Source
var ErrVarIntNotCanonical = errors.New("decoded varint is not canonical")

ErrVarIntNotCanonical signals that the decoded varint was not minimally encoded.

Functions

func DBigSize added in v1.0.3

func DBigSize(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

DBigSize decodes an uint32 or an uint64 using BigSize format. An error is returned if val is not either *uint32 or *uint64.

func DBool added in v1.1.2

func DBool(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

DBool decodes a boolean. An error is returned if val is not a boolean.

func DBytes32

func DBytes32(r io.Reader, val interface{}, _ *[8]byte, l uint64) error

DBytes32 is a Decoder for 32-byte arrays. An error is returned if val is not a *[32]byte.

func DBytes33

func DBytes33(r io.Reader, val interface{}, _ *[8]byte, l uint64) error

DBytes33 is a Decoder for 33-byte arrays. An error is returned if val is not a *[33]byte.

func DBytes64

func DBytes64(r io.Reader, val interface{}, _ *[8]byte, l uint64) error

DBytes64 is an Decoder for 64-byte arrays. An error is returned if val is not a *[64]byte.

func DNOP

func DNOP(io.Reader, interface{}, *[8]byte, uint64) error

DNOP is an encoder that doesn't modify the io.Reader and never fails.

func DPubKey

func DPubKey(r io.Reader, val interface{}, _ *[8]byte, l uint64) error

DPubKey is a Decoder for *btcec.PublicKey values. An error is returned if val is not a **btcec.PublicKey.

func DTUint16

func DTUint16(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

DTUint16 is an Decoder for truncated uint16 values, where leading zeros will be resurrected. An error is returned if val is not a *uint16.

func DTUint32

func DTUint32(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

DTUint32 is an Decoder for truncated uint32 values, where leading zeros will be resurrected. An error is returned if val is not a *uint32.

func DTUint64

func DTUint64(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

DTUint64 is an Decoder for truncated uint64 values, where leading zeros will be resurrected. An error is returned if val is not a *uint64.

func DUint16

func DUint16(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

DUint16 is a Decoder for uint16 values. An error is returned if val is not a *uint16.

func DUint32

func DUint32(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

DUint32 is a Decoder for uint32 values. An error is returned if val is not a *uint32.

func DUint64

func DUint64(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

DUint64 is a Decoder for uint64 values. An error is returned if val is not a *uint64.

func DUint8

func DUint8(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

DUint8 is a Decoder for uint8 values. An error is returned if val is not a *uint8.

func DVarBytes

func DVarBytes(r io.Reader, val interface{}, _ *[8]byte, l uint64) error

DVarBytes is a Decoder for variable byte slices. An error is returned if val is not *[]byte.

func EBigSize added in v1.0.3

func EBigSize(w io.Writer, val interface{}, buf *[8]byte) error

EBigSize encodes an uint32 or an uint64 using BigSize format. An error is returned if val is not either *uint32 or *uint64.

func EBool added in v1.1.2

func EBool(w io.Writer, val interface{}, buf *[8]byte) error

EBool encodes a boolean. An error is returned if val is not a boolean.

func EBoolT added in v1.1.2

func EBoolT(w io.Writer, val bool, buf *[8]byte) error

EBoolT encodes a bool val to the provided io.Writer. This method is exposed so that encodings for custom bool-like types can be created without incurring an extra heap allocation.

func EBytes32

func EBytes32(w io.Writer, val interface{}, _ *[8]byte) error

EBytes32 is an Encoder for 32-byte arrays. An error is returned if val is not a *[32]byte.

func EBytes33

func EBytes33(w io.Writer, val interface{}, _ *[8]byte) error

EBytes33 is an Encoder for 33-byte arrays. An error is returned if val is not a *[33]byte.

func EBytes64

func EBytes64(w io.Writer, val interface{}, _ *[8]byte) error

EBytes64 is an Encoder for 64-byte arrays. An error is returned if val is not a *[64]byte.

func ENOP

func ENOP(io.Writer, interface{}, *[8]byte) error

ENOP is an encoder that doesn't modify the io.Writer and never fails.

func EPubKey

func EPubKey(w io.Writer, val interface{}, _ *[8]byte) error

EPubKey is an Encoder for *btcec.PublicKey values. An error is returned if val is not a **btcec.PublicKey.

func ETUint16

func ETUint16(w io.Writer, val interface{}, buf *[8]byte) error

ETUint16 is an Encoder for truncated uint16 values, where leading zeros will be omitted. An error is returned if val is not a *uint16.

func ETUint16T added in v1.0.1

func ETUint16T(w io.Writer, val uint16, buf *[8]byte) error

ETUint16T is an Encoder for truncated uint16 values, where leading zeros will be omitted. An error is returned if val is not a *uint16.

func ETUint32

func ETUint32(w io.Writer, val interface{}, buf *[8]byte) error

ETUint32 is an Encoder for truncated uint32 values, where leading zeros will be omitted. An error is returned if val is not a *uint32.

func ETUint32T added in v1.0.1

func ETUint32T(w io.Writer, val uint32, buf *[8]byte) error

ETUint32T is an Encoder for truncated uint32 values, where leading zeros will be omitted. An error is returned if val is not a *uint32.

func ETUint64

func ETUint64(w io.Writer, val interface{}, buf *[8]byte) error

ETUint64 is an Encoder for truncated uint64 values, where leading zeros will be omitted. An error is returned if val is not a *uint64.

func ETUint64T added in v1.0.1

func ETUint64T(w io.Writer, val uint64, buf *[8]byte) error

ETUint64T is an Encoder for truncated uint64 values, where leading zeros will be omitted. An error is returned if val is not a *uint64.

func EUint16

func EUint16(w io.Writer, val interface{}, buf *[8]byte) error

EUint16 is an Encoder for uint16 values. An error is returned if val is not a *uint16.

func EUint16T

func EUint16T(w io.Writer, val uint16, buf *[8]byte) error

EUint16T encodes a uint16 val to the provided io.Writer. This method is exposed so that encodings for custom uint16-like types can be created without incurring an extra heap allocation.

func EUint32

func EUint32(w io.Writer, val interface{}, buf *[8]byte) error

EUint32 is an Encoder for uint32 values. An error is returned if val is not a *uint32.

func EUint32T

func EUint32T(w io.Writer, val uint32, buf *[8]byte) error

EUint32T encodes a uint32 val to the provided io.Writer. This method is exposed so that encodings for custom uint32-like types can be created without incurring an extra heap allocation.

func EUint64

func EUint64(w io.Writer, val interface{}, buf *[8]byte) error

EUint64 is an Encoder for uint64 values. An error is returned if val is not a *uint64.

func EUint64T

func EUint64T(w io.Writer, val uint64, buf *[8]byte) error

EUint64T encodes a uint64 val to the provided io.Writer. This method is exposed so that encodings for custom uint64-like types can be created without incurring an extra heap allocation.

func EUint8

func EUint8(w io.Writer, val interface{}, buf *[8]byte) error

EUint8 is an Encoder for uint8 values. An error is returned if val is not a *uint8.

func EUint8T

func EUint8T(w io.Writer, val uint8, buf *[8]byte) error

EUint8T encodes a uint8 val to the provided io.Writer. This method is exposed so that encodings for custom uint8-like types can be created without incurring an extra heap allocation.

func EVarBytes

func EVarBytes(w io.Writer, val interface{}, _ *[8]byte) error

EVarBytes is an Encoder for variable byte slices. An error is returned if val is not *[]byte.

func ReadVarInt

func ReadVarInt(r io.Reader, buf *[8]byte) (uint64, error)

ReadVarInt reads a variable length integer from r and returns it as a uint64.

func RecordsToMap

func RecordsToMap(records []Record) (map[uint64][]byte, error)

RecordsToMap encodes a series of TLV records as raw key-value pairs in the form of a map.

func SizeTUint16

func SizeTUint16(v uint16) uint64

SizeTUint16 returns the number of bytes remaining in a uint16 after truncating the leading zeros.

func SizeTUint32

func SizeTUint32(v uint32) uint64

SizeTUint32 returns the number of bytes remaining in a uint32 after truncating the leading zeros.

func SizeTUint64

func SizeTUint64(v uint64) uint64

SizeTUint64 returns the number of bytes remaining in a uint64 after truncating the leading zeros.

func SortRecords

func SortRecords(records []Record)

SortRecords is a helper function that will sort a slice of records in place according to their type.

func VarIntSize added in v1.0.1

func VarIntSize(val uint64) uint64

VarIntSize returns the required number of bytes to encode a var int.

func WriteVarInt

func WriteVarInt(w io.Writer, val uint64, buf *[8]byte) error

WriteVarInt serializes val to w using a variable number of bytes depending on its value.

Types

type Decoder

type Decoder func(r io.Reader, val interface{}, buf *[8]byte, l uint64) error

Decoder is a signature for methods that can decode TLV values. An error should be returned if the Decoder cannot support the underlying type of val. The provided scratch buffer must be non-nil.

type Encoder

type Encoder func(w io.Writer, val interface{}, buf *[8]byte) error

Encoder is a signature for methods that can encode TLV values. An error should be returned if the Encoder cannot support the underlying type of val. The provided scratch buffer must be non-nil.

func StubEncoder

func StubEncoder(v []byte) Encoder

StubEncoder is a factory function that makes a stub tlv.Encoder out of a raw value. We can use this to make a record that can be encoded when we don't actually know it's true underlying value, and only it serialization.

type ErrTypeForDecoding

type ErrTypeForDecoding struct {
	// contains filtered or unexported fields
}

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.

func NewTypeForDecodingErr

func NewTypeForDecodingErr(val interface{}, expType string,
	valLength, expLength uint64) ErrTypeForDecoding

NewTypeForDecodingErr creates a new ErrTypeForDecoding given the incorrect val and expected type, or the mismatch in their expected lengths.

func (ErrTypeForDecoding) Error

func (e ErrTypeForDecoding) Error() string

Error returns a human-readable description of the type mismatch.

type ErrTypeForEncoding

type ErrTypeForEncoding struct {
	// contains filtered or unexported fields
}

ErrTypeForEncoding signals that an incorrect type was passed to an Encoder.

func NewTypeForEncodingErr

func NewTypeForEncodingErr(val interface{}, expType string) ErrTypeForEncoding

NewTypeForEncodingErr creates a new ErrTypeForEncoding given the incorrect val and the expected type.

func (ErrTypeForEncoding) Error

func (e ErrTypeForEncoding) Error() string

Error returns a human-readable description of the type mismatch.

type OptionalRecordT added in v1.2.0

type OptionalRecordT[T TlvType, V any] struct {
	fn.Option[RecordT[T, V]]
}

OptionalRecordT is a high-order type that represents an optional TLV record. This can be used when a TLV record doesn't always need to be present (ok to be odd).

func SomeRecordT added in v1.2.1

func SomeRecordT[T TlvType, V any](record RecordT[T, V]) OptionalRecordT[T, V]

SomeRecordT creates a new OptionalRecordT type from a given RecordT type.

func (*OptionalRecordT[T, V]) TlvType added in v1.2.1

func (t *OptionalRecordT[T, V]) TlvType() Type

TlvType returns the type of the record. This is the value used to identify this type on the wire. This value is bound to the specified TlvType type param.

func (*OptionalRecordT[T, V]) UnwrapOrErrV added in v1.2.3

func (o *OptionalRecordT[T, V]) UnwrapOrErrV(err error) (V, error)

UnwrapOrErr is used to extract a value from an option, if the option is empty, then the specified error is returned directly. This gives the underlying value of the record, instead of the record itself.

func (*OptionalRecordT[T, V]) UnwrapOrFailV added in v1.2.3

func (o *OptionalRecordT[T, V]) UnwrapOrFailV(t *testing.T) V

UnwrapOrFailV is used to extract a value from an option within a test context. If the option is None, then the test fails. This gives the underlying value of the record, rather then the record itself.

func (*OptionalRecordT[T, V]) WhenSomeV added in v1.2.1

func (t *OptionalRecordT[T, V]) WhenSomeV(f func(V))

WhenSomeV executes the given function if the optional record is present. This operates on the inner most type, V, which is the value of the record.

func (*OptionalRecordT[T, V]) Zero added in v1.2.3

func (t *OptionalRecordT[T, V]) Zero() RecordT[T, V]

Zero returns a zero value of the record type.

type Primitive added in v1.2.0

type Primitive interface {
	constraints.Unsigned | ~[]byte | ~[32]byte | ~[33]byte | ~bool |
		~*btcec.PublicKey | ~[64]byte
}

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

type Record

type Record struct {
	// contains filtered or unexported fields
}

Record holds the required information to encode or decode a TLV record.

func MakeBigSizeRecord added in v1.0.3

func MakeBigSizeRecord(typ Type, val interface{}) Record

MakeBigSizeRecord creates a tlv record using the BigSize format. The only allowed values are uint64 and uint32.

NOTE: for uint32, we would only gain space reduction if the encoded value is no greater than 65535, which requires at most 3 bytes to encode.

func MakeDynamicRecord

func MakeDynamicRecord(typ Type, val interface{}, sizeFunc SizeFunc,
	encoder Encoder, decoder Decoder) Record

MakeDynamicRecord creates a record whose size may vary, and will be determined at the time of encoding via sizeFunc.

func MakePrimitiveRecord

func MakePrimitiveRecord(typ Type, val interface{}) Record

MakePrimitiveRecord creates a record for common types.

func MakeStaticRecord

func MakeStaticRecord(typ Type, val interface{}, size uint64, encoder Encoder,
	decoder Decoder) Record

MakeStaticRecord creates a record for a field of fixed-size

func MapToRecords

func MapToRecords(tlvMap map[uint64][]byte) []Record

MapToRecords encodes the passed TLV map as a series of regular tlv.Record instances. The resulting set of records will be returned in sorted order by their type.

func (*Record) Decode added in v1.0.1

func (f *Record) Decode(r io.Reader, l uint64) error

Decode read in the TLV record from the passed reader. This is useful when a caller wants decode a *single* TLV record, outside the context of the Stream struct.

func (*Record) Encode

func (f *Record) Encode(w io.Writer) error

Encode writes out the TLV record to the passed writer. This is useful when a caller wants to obtain the raw encoding of a *single* TLV record, outside the context of the Stream struct.

func (*Record) Record added in v1.2.4

func (f *Record) Record() Record

Record (the function) is the trivial implementation of RecordProducer for Record (the type). This makes it seamless to mix primitive and dynamic records together in the same collections.

NOTE: Part of the RecordProducer interface.

func (*Record) Size

func (f *Record) Size() uint64

Size returns the size of the Record's value. If no static size is known, the dynamic size will be evaluated.

func (*Record) Type

func (f *Record) Type() Type

Type returns the type of the underlying TLV record.

type RecordProducer added in v1.0.1

type RecordProducer interface {
	// Record returns a Record that can be used to encode or decode the
	// backing object.
	Record() Record
}

RecorderProducer is an interface for objects that can produce a Record object capable of encoding and/or decoding the RecordProducer as a Record.

type RecordProducerT added in v1.2.0

type RecordProducerT[T any] interface {
	RecordProducer

	*T
}

RecordProducerT is a type-aware wrapper around the normal RecordProducer interface.

type RecordT added in v1.2.0

type RecordT[T TlvType, V any] struct {

	// val is the value of the underlying record. Go doesn't let us just
	// embed the type param as a struct field, so we need an intermediate
	// variable.
	Val V
	// contains filtered or unexported fields
}

RecordT is a high-order type makes it easy to encode known "primitive" types as TLV records.

func NewPrimitiveRecord added in v1.2.0

func NewPrimitiveRecord[T TlvType, V Primitive](val V) RecordT[T, V]

NewPrimitiveRecord creates a new RecordT type from a given primitive type.

func NewRecordT added in v1.2.0

func NewRecordT[T TlvType, K any, V RecordProducerT[K]](
	record K,
) RecordT[T, K]

NewRecordT creates a new RecordT type from a given RecordProducer type. This is useful to wrap a given record in this utility type, which also serves as an extra type annotation. The underlying type of the record is retained.

func ZeroRecordT added in v1.2.0

func ZeroRecordT[T TlvType, V any]() RecordT[T, V]

ZeroRecordT returns a zero value of the RecordT type.

func (*RecordT[T, V]) Record added in v1.2.0

func (t *RecordT[T, V]) Record() Record

Record returns the underlying record interface for the record type.

func (*RecordT[T, V]) TlvType added in v1.2.1

func (t *RecordT[T, V]) TlvType() Type

TlvType returns the type of the record. This is the value used to identify this type on the wire. This value is bound to the specified TlvType type param.

func (*RecordT[T, V]) Zero added in v1.2.2

func (t *RecordT[T, V]) Zero() RecordT[T, V]

Zero returns a zero value of the record type.

type SizeFunc

type SizeFunc func() uint64

SizeFunc is a function that can compute the length of a given field. Since the size of the underlying field can change, this allows the size of the field to be evaluated at the time of encoding.

func SizeBigSize added in v1.0.3

func SizeBigSize(val interface{}) SizeFunc

SizeBigSize returns a SizeFunc that can compute the length of BigSize.

func SizeVarBytes

func SizeVarBytes(e *[]byte) SizeFunc

SizeVarBytes returns a SizeFunc that can compute the length of a byte slice.

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

Stream defines a TLV stream that can be used for encoding or decoding a set of TLV Records.

func MustNewStream

func MustNewStream(records ...Record) *Stream

MustNewStream creates a new TLV Stream given an encoding codec, a decoding codec, and a set of known records. If an error is encountered in creating the stream, this method will panic instead of returning the error.

func NewStream

func NewStream(records ...Record) (*Stream, error)

NewStream creates a new TLV Stream given an encoding codec, a decoding codec, and a set of known records.

func (*Stream) Decode

func (s *Stream) Decode(r io.Reader) error

Decode deserializes TLV Stream from the passed io.Reader for non-P2P settings. The Stream will inspect each record that is parsed and check to see if it has a corresponding Record to facilitate deserialization of that field. If the record is unknown, the Stream will discard the record's bytes and proceed to the subsequent record.

Each record has the following format:

[varint: type]
[varint: length]
[length: value]

A series of (possibly zero) records are concatenated into a stream, this example contains two records:

(t: 0x01, l: 0x04, v: 0xff, 0xff, 0xff, 0xff)
(t: 0x02, l: 0x01, v: 0x01)

This method asserts that the byte stream is canonical, namely that each record is unique and that all records are sorted in ascending order. An ErrNotCanonicalStream error is returned if the encoded TLV stream is not.

We permit an io.EOF error only when reading the type byte which signals that the last record was read cleanly and we should stop parsing. All other io.EOF or io.ErrUnexpectedEOF errors are returned.

func (*Stream) DecodeP2P added in v1.1.0

func (s *Stream) DecodeP2P(r io.Reader) error

DecodeP2P is identical to Decode except that the maximum record size is capped at 65535.

func (*Stream) DecodeWithParsedTypes added in v1.0.1

func (s *Stream) DecodeWithParsedTypes(r io.Reader) (TypeMap, error)

DecodeWithParsedTypes is identical to Decode, but if successful, returns a TypeMap containing the types of all records that were decoded or ignored from the stream.

func (*Stream) DecodeWithParsedTypesP2P added in v1.1.0

func (s *Stream) DecodeWithParsedTypesP2P(r io.Reader) (TypeMap, error)

DecodeWithParsedTypesP2P is identical to DecodeWithParsedTypes except that the record size is capped at 65535. This should only be called from a p2p setting where untrusted input is being deserialized.

func (*Stream) Encode

func (s *Stream) Encode(w io.Writer) error

Encode writes a Stream to the passed io.Writer. Each of the Records known to the Stream is written in ascending order of their type so as to be canonical.

The stream is constructed by concatenating the individual, serialized Records where each record has the following format:

[varint: type]
[varint: length]
[length: value]

An error is returned if the io.Writer fails to accept bytes from the encoding, and nothing else. The ordering of the Records is asserted upon the creation of a Stream, and thus the output will be by definition canonical.

type TlvType added in v1.2.0

type TlvType interface {
	// TypeVal returns the integer TLV type that this TlvType struct
	// instance maps to.
	TypeVal() Type
	// contains filtered or unexported methods
}

TlvType is an interface used to enable binding the integer type of a TLV record to the type at compile time.

type TlvType0 added in v1.2.0

type TlvType0 = *tlvType0

type TlvType1 added in v1.2.0

type TlvType1 = *tlvType1

type TlvType10 added in v1.2.0

type TlvType10 = *tlvType10

type TlvType100 added in v1.2.0

type TlvType100 = *tlvType100

type TlvType11 added in v1.2.0

type TlvType11 = *tlvType11

type TlvType12 added in v1.2.0

type TlvType12 = *tlvType12

type TlvType13 added in v1.2.0

type TlvType13 = *tlvType13

type TlvType14 added in v1.2.0

type TlvType14 = *tlvType14

type TlvType15 added in v1.2.0

type TlvType15 = *tlvType15

type TlvType16 added in v1.2.0

type TlvType16 = *tlvType16

type TlvType17 added in v1.2.0

type TlvType17 = *tlvType17

type TlvType18 added in v1.2.0

type TlvType18 = *tlvType18

type TlvType19 added in v1.2.0

type TlvType19 = *tlvType19

type TlvType2 added in v1.2.0

type TlvType2 = *tlvType2

type TlvType20 added in v1.2.0

type TlvType20 = *tlvType20

type TlvType21 added in v1.2.0

type TlvType21 = *tlvType21

type TlvType22 added in v1.2.0

type TlvType22 = *tlvType22

type TlvType23 added in v1.2.0

type TlvType23 = *tlvType23

type TlvType24 added in v1.2.0

type TlvType24 = *tlvType24

type TlvType25 added in v1.2.0

type TlvType25 = *tlvType25

type TlvType26 added in v1.2.0

type TlvType26 = *tlvType26

type TlvType27 added in v1.2.0

type TlvType27 = *tlvType27

type TlvType28 added in v1.2.0

type TlvType28 = *tlvType28

type TlvType29 added in v1.2.0

type TlvType29 = *tlvType29

type TlvType3 added in v1.2.0

type TlvType3 = *tlvType3

type TlvType30 added in v1.2.0

type TlvType30 = *tlvType30

type TlvType31 added in v1.2.0

type TlvType31 = *tlvType31

type TlvType32 added in v1.2.0

type TlvType32 = *tlvType32

type TlvType33 added in v1.2.0

type TlvType33 = *tlvType33

type TlvType34 added in v1.2.0

type TlvType34 = *tlvType34

type TlvType35 added in v1.2.0

type TlvType35 = *tlvType35

type TlvType36 added in v1.2.0

type TlvType36 = *tlvType36

type TlvType37 added in v1.2.0

type TlvType37 = *tlvType37

type TlvType38 added in v1.2.0

type TlvType38 = *tlvType38

type TlvType39 added in v1.2.0

type TlvType39 = *tlvType39

type TlvType4 added in v1.2.0

type TlvType4 = *tlvType4

type TlvType40 added in v1.2.0

type TlvType40 = *tlvType40

type TlvType41 added in v1.2.0

type TlvType41 = *tlvType41

type TlvType42 added in v1.2.0

type TlvType42 = *tlvType42

type TlvType43 added in v1.2.0

type TlvType43 = *tlvType43

type TlvType44 added in v1.2.0

type TlvType44 = *tlvType44

type TlvType45 added in v1.2.0

type TlvType45 = *tlvType45

type TlvType46 added in v1.2.0

type TlvType46 = *tlvType46

type TlvType47 added in v1.2.0

type TlvType47 = *tlvType47

type TlvType48 added in v1.2.0

type TlvType48 = *tlvType48

type TlvType49 added in v1.2.0

type TlvType49 = *tlvType49

type TlvType5 added in v1.2.0

type TlvType5 = *tlvType5

type TlvType50 added in v1.2.0

type TlvType50 = *tlvType50

type TlvType51 added in v1.2.0

type TlvType51 = *tlvType51

type TlvType52 added in v1.2.0

type TlvType52 = *tlvType52

type TlvType53 added in v1.2.0

type TlvType53 = *tlvType53

type TlvType54 added in v1.2.0

type TlvType54 = *tlvType54

type TlvType55 added in v1.2.0

type TlvType55 = *tlvType55

type TlvType56 added in v1.2.0

type TlvType56 = *tlvType56

type TlvType57 added in v1.2.0

type TlvType57 = *tlvType57

type TlvType58 added in v1.2.0

type TlvType58 = *tlvType58

type TlvType59 added in v1.2.0

type TlvType59 = *tlvType59

type TlvType6 added in v1.2.0

type TlvType6 = *tlvType6

type TlvType60 added in v1.2.0

type TlvType60 = *tlvType60

type TlvType61 added in v1.2.0

type TlvType61 = *tlvType61

type TlvType62 added in v1.2.0

type TlvType62 = *tlvType62

type TlvType63 added in v1.2.0

type TlvType63 = *tlvType63

type TlvType64 added in v1.2.0

type TlvType64 = *tlvType64

type TlvType65 added in v1.2.0

type TlvType65 = *tlvType65

type TlvType66 added in v1.2.0

type TlvType66 = *tlvType66

type TlvType67 added in v1.2.0

type TlvType67 = *tlvType67

type TlvType68 added in v1.2.0

type TlvType68 = *tlvType68

type TlvType69 added in v1.2.0

type TlvType69 = *tlvType69

type TlvType7 added in v1.2.0

type TlvType7 = *tlvType7

type TlvType70 added in v1.2.0

type TlvType70 = *tlvType70

type TlvType71 added in v1.2.0

type TlvType71 = *tlvType71

type TlvType72 added in v1.2.0

type TlvType72 = *tlvType72

type TlvType73 added in v1.2.0

type TlvType73 = *tlvType73

type TlvType74 added in v1.2.0

type TlvType74 = *tlvType74

type TlvType75 added in v1.2.0

type TlvType75 = *tlvType75

type TlvType76 added in v1.2.0

type TlvType76 = *tlvType76

type TlvType77 added in v1.2.0

type TlvType77 = *tlvType77

type TlvType78 added in v1.2.0

type TlvType78 = *tlvType78

type TlvType79 added in v1.2.0

type TlvType79 = *tlvType79

type TlvType8 added in v1.2.0

type TlvType8 = *tlvType8

type TlvType80 added in v1.2.0

type TlvType80 = *tlvType80

type TlvType81 added in v1.2.0

type TlvType81 = *tlvType81

type TlvType82 added in v1.2.0

type TlvType82 = *tlvType82

type TlvType83 added in v1.2.0

type TlvType83 = *tlvType83

type TlvType84 added in v1.2.0

type TlvType84 = *tlvType84

type TlvType85 added in v1.2.0

type TlvType85 = *tlvType85

type TlvType86 added in v1.2.0

type TlvType86 = *tlvType86

type TlvType87 added in v1.2.0

type TlvType87 = *tlvType87

type TlvType88 added in v1.2.0

type TlvType88 = *tlvType88

type TlvType89 added in v1.2.0

type TlvType89 = *tlvType89

type TlvType9 added in v1.2.0

type TlvType9 = *tlvType9

type TlvType90 added in v1.2.0

type TlvType90 = *tlvType90

type TlvType91 added in v1.2.0

type TlvType91 = *tlvType91

type TlvType92 added in v1.2.0

type TlvType92 = *tlvType92

type TlvType93 added in v1.2.0

type TlvType93 = *tlvType93

type TlvType94 added in v1.2.0

type TlvType94 = *tlvType94

type TlvType95 added in v1.2.0

type TlvType95 = *tlvType95

type TlvType96 added in v1.2.0

type TlvType96 = *tlvType96

type TlvType97 added in v1.2.0

type TlvType97 = *tlvType97

type TlvType98 added in v1.2.0

type TlvType98 = *tlvType98

type TlvType99 added in v1.2.0

type TlvType99 = *tlvType99

type Type

type Type uint64

Type is an 64-bit identifier for a TLV Record.

type TypeMap added in v1.0.1

type TypeMap map[Type][]byte

TypeMap is a map of parsed Types. The map values are byte slices. If the byte slice is nil, the type was successfully parsed. Otherwise the value is byte slice containing the encoded data.

Directories

Path Synopsis
internal
gen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL