Documentation
¶
Index ¶
- Constants
- func Decode(r io.Reader, v interface{}, stopField string) error
- func Encode(v interface{}, w io.Writer) error
- func Marshal(v interface{}) ([]byte, error)
- func PackArraySize(writer io.Writer, length uint16) (n int, err error)
- func PackBin16(writer io.Writer, value []byte) (n int, err error)
- func PackBool(writer io.Writer, value bool) (n int, err error)
- func PackExt16(writer io.Writer, t byte, value []byte) (n int, err error)
- func PackNil(writer io.Writer) (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 ReadByte(reader io.Reader) (v uint8, err error)
- func ReadUint16(reader io.Reader) (v uint16, n int, err error)
- func ReadUint32(reader io.Reader) (v uint32, n int, err error)
- func ReadUint64(reader io.Reader) (v uint64, n int, err error)
- func SetIgnoreRule(structName string, rule IgnoreRule)
- func TryUnpackNil(reader io.Reader) (suc bool, err error)
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalUntilField(data []byte, v interface{}, stopField string) error
- func UnpackArraySize(reader io.Reader) (size uint16, err error)
- func UnpackBin16(reader io.Reader) ([]byte, error)
- func UnpackBool(reader io.Reader) (v bool, err error)
- func UnpackExt16(reader io.Reader) ([]byte, 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
- type DecodeContext
- type Decoder
- type DecoderReader
- type EncodeContext
- type EncodeWriter
- type Encoder
- type IgnoreRule
Constants ¶
View Source
const ( // NIL nil or null type identifier NIL = 0xc0 // FALSE is a Bool type identifier FALSE = 0xc2 // TRUE is a Bool type identifier TRUE = 0xc3 //BIN16 is byte array type identifier BIN16 = 0xc5 //EXT16 is extension type identifier EXT16 = 0xc8 //UINT8 is uint8 type identifier UINT8 = 0xcc //UINT16 is uint16 type identifier UINT16 = 0xcd //UINT32 is uint32 type identifier UINT32 = 0xce //UINT64 is uint64 type identifier UINT64 = 0xcf //STR16 is string type identifier STR16 = 0xda //ARRAY16 is array size type identifier ARRAY16 = 0xdc )
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 )
View Source
const (
EXT_BIGINT = 1
)
Variables ¶
This section is empty.
Functions ¶
func PackArraySize ¶
PackArraySize is to pack a array size header.
func PackUint16 ¶
PackUint16 is to pack a uint16
func PackUint32 ¶
PackUint32 is to pack a uint32.
func PackUint64 ¶
PackUint64 is to pack a uint64.
func SetIgnoreRule ¶
func SetIgnoreRule(structName string, rule IgnoreRule)
func TryUnpackNil ¶
UnpackBool is to unpack message
func UnmarshalUntilField ¶
unserialize the message until stopField
func UnpackArraySize ¶
UnpackArraySize is to unpack message
func UnpackBin16 ¶
UnpackBin16 is to unpack message
func UnpackBool ¶
UnpackBool 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 ¶
type DecodeContext ¶
type DecodeContext struct {
// contains filtered or unexported fields
}
type DecoderReader ¶
type DecoderReader func(reflect.Value, *DecodeContext) error
DecoderReader function type of the decoder
type EncodeContext ¶
type EncodeContext struct {
// contains filtered or unexported fields
}
type EncodeWriter ¶
EncodeWriter function type of the encoder
type IgnoreRule ¶
type IgnoreRule func(reflect.StructField, int, interface{}, interface{}) bool
ignore field rule, params:field, index of field in struct, cur struct value(e.g. Header), top struct value(e.g. Block)
Click to show internal directories.
Click to hide internal directories.