msgpack

package
v3.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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 Decode

func Decode(r io.Reader, dst interface{}) error

Decode is to encode message

func Encode

func Encode(w io.Writer, structs interface{}) error

Encode is to encode message

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal is to serialize the message

func PackArraySize

func PackArraySize(writer io.Writer, length uint16) (n int, err error)

PackArraySize is to pack a given value and writes it into the specified writer.

func PackBin

func PackBin(writer io.Writer, value []byte) (n int, err error)

PackBin is to pack a given value and writes it into the specified writer.

func PackBin16

func PackBin16(writer io.Writer, value []byte) (n int, err error)

PackBin16 is to pack a given value and writes it into the specified writer.

func PackBin32

func PackBin32(writer io.Writer, value []byte) (n int, err error)

PackBin32 is to pack a given value and writes it into the specified writer.

func PackStr16

func PackStr16(writer io.Writer, value string) (n int, err error)

PackStr16 is to pack a given value and writes it into the specified writer.

func PackUint8

func PackUint8(writer io.Writer, value uint8) (n int, err error)

PackUint8 is to pack a given value and writes it into the specified writer.

func PackUint16

func PackUint16(writer io.Writer, value uint16) (n int, err error)

PackUint16 is to pack a given value and writes it into the specified writer.

func PackUint32

func PackUint32(writer io.Writer, value uint32) (n int, err error)

PackUint32 is to pack a given value and writes it into the specified writer.

func PackUint64

func PackUint64(writer io.Writer, value uint64) (n int, err error)

PackUint64 is to pack a given value and writes it into the specified writer.

func Unmarshal

func Unmarshal(data []byte, dst interface{}) error

Unmarshal is to unserialize the message

func UnpackArraySize

func UnpackArraySize(reader io.Reader) (size uint16, err error)

UnpackArraySize is to unpack message

func UnpackBin

func UnpackBin(reader io.Reader) ([]byte, error)

UnpackBin is to unpack message

func UnpackBin16

func UnpackBin16(reader io.Reader) ([]byte, error)

UnpackBin16 is to unpack message

func UnpackStr16

func UnpackStr16(reader io.Reader) (string, error)

UnpackStr16 is to unpack message

func UnpackUint8

func UnpackUint8(reader io.Reader) (v uint8, err error)

UnpackUint8 is to unpack message

func UnpackUint16

func UnpackUint16(reader io.Reader) (v uint16, err error)

UnpackUint16 is to unpack message

func UnpackUint32

func UnpackUint32(reader io.Reader) (v uint32, err error)

UnpackUint32 is to unpack message

func UnpackUint64

func UnpackUint64(reader io.Reader) (v uint64, err error)

UnpackUint64 is to unpack message

Types

type Bytes

type Bytes []byte

Bytes is []byte type

type Bytes1

type Bytes1 [1]byte

Bytes1 is first

type Bytes2

type Bytes2 [2]byte

Bytes2 is second

type Bytes4

type Bytes4 [4]byte

Bytes4 is third

type Bytes8

type Bytes8 [8]byte

Bytes8 is forth

Jump to

Keyboard shortcuts

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