tlv21

package
v0.0.0-...-a127847 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package tlv21 implements TLV with 2 bytes for the type and 1 byte for the length. The type field is encoded using big endian.

This package was written specifically for openspalib and so it contains a feature that would otherwise be considered a bug. There can only be once instance of a type in a container. Thus if a type in a TLV container is repeated, the parser will append it to the "singleton" type Entry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

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

func NewContainer

func NewContainer(r io.Reader) (Container, error)

func Parse

func Parse(r io.Reader) (Container, error)

func (*Container) Bytes

func (c *Container) Bytes() io.Reader

func (*Container) BytesBuffer

func (c *Container) BytesBuffer() *bytes.Buffer

func (*Container) Entry

func (c *Container) Entry(tag Tag) ([]byte, bool)

func (*Container) NoEntries

func (c *Container) NoEntries() int

func (*Container) SetEntry

func (c *Container) SetEntry(tag Tag, b []byte)

type Tag

type Tag uint16

Jump to

Keyboard shortcuts

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