Documentation ¶
Index ¶
- Variables
- func AddExtCoder(e ext.Encoder, d ext.Decoder) error
- func AddExtStreamCoder(e ext.StreamEncoder, d ext.StreamDecoder) error
- func Marshal(v interface{}) ([]byte, error)
- func MarshalAsArray(v interface{}) ([]byte, error)
- func MarshalAsMap(v interface{}) ([]byte, error)
- func MarshalWrite(w io.Writer, v interface{}) error
- func MarshalWriteAsArray(w io.Writer, v interface{}) error
- func MarshalWriteAsMap(w io.Writer, v interface{}) error
- func RemoveExtCoder(e ext.Encoder, d ext.Decoder) error
- func RemoveExtStreamCoder(e ext.StreamEncoder, d ext.StreamDecoder) error
- func SetComplexTypeCode(code int8)
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalAsArray(data []byte, v interface{}) error
- func UnmarshalAsMap(data []byte, v interface{}) error
- func UnmarshalRead(r io.Reader, v interface{}) error
- func UnmarshalReadAsArray(r io.Reader, v interface{}) error
- func UnmarshalReadAsMap(r io.Reader, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
var Error = def.ErrMsgpack
Error is used in all msgpack error as the based error.
var StructAsArray = false
StructAsArray is encoding option. If this option sets true, default encoding sets to array-format.
Functions ¶
func AddExtCoder ¶
AddExtCoder adds encoders for extension types.
func AddExtStreamCoder ¶ added in v2.2.0
func AddExtStreamCoder(e ext.StreamEncoder, d ext.StreamDecoder) error
AddExtStreamCoder adds stream encoders for extension types.
func MarshalAsArray ¶
MarshalAsArray encodes data as array format. This is the same thing that StructAsArray sets true.
func MarshalAsMap ¶
MarshalAsMap encodes data as map format. This is the same thing that StructAsArray sets false.
func MarshalWrite ¶ added in v2.2.0
MarshalWrite writes MessagePack-encoded byte array of v to writer.
func MarshalWriteAsArray ¶ added in v2.2.0
MarshalWriteAsArray writes array format encoded data to writer. This is the same thing that StructAsArray sets true.
func MarshalWriteAsMap ¶ added in v2.2.0
MarshalWriteAsMap writes map format encoded data to writer. This is the same thing that StructAsArray sets false.
func RemoveExtCoder ¶
RemoveExtCoder removes encoders for extension types.
func RemoveExtStreamCoder ¶ added in v2.2.0
func RemoveExtStreamCoder(e ext.StreamEncoder, d ext.StreamDecoder) error
RemoveExtStreamCoder removes stream encoders for extension types.
func SetComplexTypeCode ¶
func SetComplexTypeCode(code int8)
SetComplexTypeCode sets def.complexTypeCode
func Unmarshal ¶
Unmarshal analyzes the MessagePack-encoded data and stores the result into the pointer of v.
func UnmarshalAsArray ¶
UnmarshalAsArray decodes data that is encoded as array format. This is the same thing that StructAsArray sets true.
func UnmarshalAsMap ¶
UnmarshalAsMap decodes data that is encoded as map format. This is the same thing that StructAsArray sets false.
func UnmarshalRead ¶ added in v2.2.0
UnmarshalRead reads the MessagePack-encoded data from reader and stores the result into the pointer of v.
func UnmarshalReadAsArray ¶ added in v2.2.0
UnmarshalReadAsArray decodes from stream. stream data expects array format. This is the same thing that StructAsArray sets true.
func UnmarshalReadAsMap ¶ added in v2.2.0
UnmarshalReadAsMap decodes from stream. stream data expects map format. This is the same thing that StructAsArray sets false.
Types ¶
This section is empty.