tlv

package
v0.0.0-...-17dadc4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMessageTooShort = errors.New("tlv: message too short")

Functions

This section is empty.

Types

type Decoder

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

Decoder is a configurable TLV decoder.

func NewDecoder

func NewDecoder(tagSize, lenSize uint8) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(data []byte) ([]Record, error)

func (*Decoder) DecodeRecordMap

func (d *Decoder) DecodeRecordMap(data []byte) (RecordMap, error)

type Record

type Record struct {
	Tag    int
	Length int
	Value  []byte
}

Record represents a Tag-Length-Value record.

type RecordMap

type RecordMap map[int][]byte

func (RecordMap) Exists

func (rm RecordMap) Exists(key int) bool

Jump to

Keyboard shortcuts

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