tlv

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2015 License: MIT Imports: 5 Imported by: 20

Documentation

Index

Constants

View Source
const (
	TLV_FLOAT64 = 1
	TLV_FLOAT32 = 2
	TLV_INT8    = 3
	TLV_INT16   = 4
	TLV_INT32   = 5
	TLV_INT64   = 6
	TLV_UINT8   = 7
	TLV_UINT16  = 8
	TLV_UINT32  = 9
	TLV_UINT64  = 10
	TLV_BYTES   = 11
	TLV_URI     = 12
	TLV_BOOL    = 13
)

Variables

This section is empty.

Functions

func ByteToUint16

func ByteToUint16(buf []byte) uint16

func CastTLV

func CastTLV(value interface{}, valueType int32) interface{}

func ReadTLV

func ReadTLV(tlv *TLV) (interface{}, error)

func ReadTLVs

func ReadTLVs(tlvs []TLV) ([]interface{}, error)

func Uint16ToByte

func Uint16ToByte(value uint16) []byte

Types

type TLV

type TLV struct {
	Tag   uint16
	Value []byte
}

func MakeTLV

func MakeTLV(a interface{}) (*TLV, error)

func MakeTLVs

func MakeTLVs(a []interface{}) ([]TLV, error)

func (*TLV) FromBinary

func (tlv *TLV) FromBinary(r io.Reader) error

func (*TLV) Length

func (tlv *TLV) Length() int

func (*TLV) ToBinary

func (tlv *TLV) ToBinary() []byte

Jump to

Keyboard shortcuts

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