tlv

package
v0.0.0-...-54bdd87 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 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