Documentation
¶
Overview ¶
Package tlv8 implements TLV with 1 bytes for the type and 1 byte for the length.
Type field can be anything from 1-255. Type=0 is reserved, internally it is used as a separator between two TLV8 items of the same type.
The library is not safe for concurrency. It is up to the caller to ensure multiple calls from different goroutines are not being triggered to the same Container
Index ¶
- Constants
- type Container
- func (c *Container) Add(i Item)
- func (c *Container) AddMultiple(i []Item)
- func (c *Container) Bytes() ([]byte, error)
- func (c *Container) Get(itemType uint8) []Item
- func (c *Container) GetAll() []Item
- func (c *Container) GetFirst(itemType uint8) (Item, bool)
- func (c *Container) Output(w io.Writer) error
- type ErrInvalidTLV8EncodedBuffer
- type Item
Constants ¶
View Source
const ( ErrNoSeparator = ErrInvalidTLV8EncodedBuffer("no separator between two items") ErrBadFragment = ErrInvalidTLV8EncodedBuffer("bad fragment") ErrOutOfBounds = ErrInvalidTLV8EncodedBuffer("out of bounds dues to bad length field") ErrFragmentItemInvalidLength = ErrInvalidTLV8EncodedBuffer("fragment item invalid length") ErrTooShort = ErrInvalidTLV8EncodedBuffer("too short") )
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() Container
func (*Container) AddMultiple ¶
type ErrInvalidTLV8EncodedBuffer ¶
type ErrInvalidTLV8EncodedBuffer string
func (ErrInvalidTLV8EncodedBuffer) Error ¶
func (e ErrInvalidTLV8EncodedBuffer) Error() string
Click to show internal directories.
Click to hide internal directories.