tlv

package
v0.0.0-...-ac3d764 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMalformed = errors.New("malformed TLV")
)

Functions

func UnwrapBER

func UnwrapBER(data []byte) (byte, []byte, error)

func WrapBER

func WrapBER(tag byte, value []byte) ([]byte, error)

Types

type Item

type Item struct {
	Tag   byte
	Value []byte
}

func CloneItem

func CloneItem(item Item) Item

func Consume

func Consume(data []byte) (Item, int, error)

func New

func New(tag byte, value []byte) Item

func NewComprehension

func NewComprehension(tag byte, value []byte) Item

func (Item) ComprehensionRequired

func (i Item) ComprehensionRequired() bool

func (Item) ComprehensionTag

func (i Item) ComprehensionTag() byte

func (Item) MarshalBinary

func (i Item) MarshalBinary() ([]byte, error)

func (*Item) UnmarshalBinary

func (i *Item) UnmarshalBinary(data []byte) error

func (Item) WriteTo

func (i Item) WriteTo(w io.Writer) (int64, error)

type Items

type Items []Item

func CloneItems

func CloneItems(items Items) Items

func (Items) All

func (i Items) All(tag byte) Items

func (Items) Find

func (i Items) Find(tag byte) (Item, bool)

func (Items) MarshalBinary

func (i Items) MarshalBinary() ([]byte, error)

func (*Items) ReadFrom

func (i *Items) ReadFrom(r io.Reader) (int64, error)

func (*Items) UnmarshalBinary

func (i *Items) UnmarshalBinary(data []byte) error

func (Items) WriteTo

func (i Items) WriteTo(w io.Writer) (int64, error)

Jump to

Keyboard shortcuts

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