Documentation
¶
Index ¶
- Constants
- func Decode(r io.Reader, dst interface{}) error
- func Encode(w io.Writer, structs interface{}) error
- func Marshal(v interface{}) ([]byte, error)
- func PackArraySize(writer io.Writer, length uint16) (n int, err error)
- func PackBin(writer io.Writer, value []byte) (n int, err error)
- func PackBin16(writer io.Writer, value []byte) (n int, err error)
- func PackBin32(writer io.Writer, value []byte) (n int, err error)
- func PackStr16(writer io.Writer, value string) (n int, err error)
- func PackUint8(writer io.Writer, value uint8) (n int, err error)
- func PackUint16(writer io.Writer, value uint16) (n int, err error)
- func PackUint32(writer io.Writer, value uint32) (n int, err error)
- func PackUint64(writer io.Writer, value uint64) (n int, err error)
- func Unmarshal(data []byte, dst interface{}) error
- func UnpackArraySize(reader io.Reader) (size uint16, err error)
- func UnpackBin(reader io.Reader) ([]byte, error)
- func UnpackBin16(reader io.Reader) ([]byte, error)
- func UnpackStr16(reader io.Reader) (string, error)
- func UnpackUint8(reader io.Reader) (v uint8, err error)
- func UnpackUint16(reader io.Reader) (v uint16, err error)
- func UnpackUint32(reader io.Reader) (v uint32, err error)
- func UnpackUint64(reader io.Reader) (v uint64, err error)
- type Bytes
- type Bytes1
- type Bytes2
- type Bytes4
- type Bytes8
Constants ¶
View Source
const ( //BIN16 is byte array type identifier BIN16 = 0xc5 //BIN32 is byte array type identifier BIN32 = 0xc6 //UINT8 is uint8 UINT8 = 0xcc //UINT16 is uint16 UINT16 = 0xcd //UINT32 is uint32 UINT32 = 0xce //UINT64 is uint64 UINT64 = 0xcf //STR16 is string type identifier STR16 = 0xda //ARRAY16 is array size type identifier ARRAY16 = 0xdc //LEN_INT32 value LEN_INT32 = 4 //LEN_INT64 value LEN_INT64 = 8 //MAX16BIT value MAX16BIT = 2 << (16 - 1) //REGULAR_UINT7_MAX value REGULAR_UINT7_MAX = 2 << (7 - 1) //REGULAR_UINT8_MAX value REGULAR_UINT8_MAX = 2 << (8 - 1) //REGULAR_UINT16_MAX value REGULAR_UINT16_MAX = 2 << (16 - 1) //REGULAR_UINT32_MAX value REGULAR_UINT32_MAX = 2 << (32 - 1) //SPECIAL_INT8 value SPECIAL_INT8 = 32 //SPECIAL_INT16 value SPECIAL_INT16 = 2 << (8 - 2) //SPECIAL_INT32 value SPECIAL_INT32 = 2 << (16 - 2) //SPECIAL_INT64 value SPECIAL_INT64 = 2 << (32 - 2) )
View Source
const ( //NEGFIXNUM is negfix maxnum NEGFIXNUM = 0xe0 //FIXMAPMAX is fixmap maxnum FIXMAPMAX = 0x8f //FIXARRAYMAX is fixarray maxnum FIXARRAYMAX = 0x9f //FIXRAWMAX is fix raw max FIXRAWMAX = 0xbf //FIRSTBYTEMASK is first byte mask FIRSTBYTEMASK = 0xf )
Variables ¶
This section is empty.
Functions ¶
func PackArraySize ¶
PackArraySize is to pack a given value and writes it into the specified writer.
func PackUint16 ¶
PackUint16 is to pack a given value and writes it into the specified writer.
func PackUint32 ¶
PackUint32 is to pack a given value and writes it into the specified writer.
func PackUint64 ¶
PackUint64 is to pack a given value and writes it into the specified writer.
func UnpackArraySize ¶
UnpackArraySize is to unpack message
func UnpackBin16 ¶
UnpackBin16 is to unpack message
func UnpackStr16 ¶
UnpackStr16 is to unpack message
func UnpackUint8 ¶
UnpackUint8 is to unpack message
func UnpackUint16 ¶
UnpackUint16 is to unpack message
func UnpackUint32 ¶
UnpackUint32 is to unpack message
Types ¶
Click to show internal directories.
Click to hide internal directories.