Documentation
¶
Index ¶
- Constants
- Variables
- func Marshal(v interface{}) ([]byte, error)
- func MarshalArray(a Array) ([]byte, error)
- func MarshalBinary(v []byte) ([]byte, error)
- func MarshalBool(v bool) ([]byte, error)
- func MarshalExtension(ext Extension) ([]byte, error)
- func MarshalFloat32(v float32) ([]byte, error)
- func MarshalFloat64(v float64) ([]byte, error)
- func MarshalInt(v int) ([]byte, error)
- func MarshalInt16(v int16) ([]byte, error)
- func MarshalInt32(v int32) ([]byte, error)
- func MarshalInt64(v int64) ([]byte, error)
- func MarshalInt8(v int8) ([]byte, error)
- func MarshalMap(o Map) ([]byte, error)
- func MarshalString(v string) ([]byte, error)
- func MarshalTime(t time.Time) ([]byte, error)
- func MarshalUint(v uint) ([]byte, error)
- func MarshalUint16(v uint16) ([]byte, error)
- func MarshalUint32(v uint32) ([]byte, error)
- func MarshalUint64(v uint64) ([]byte, error)
- func MarshalUint8(v uint8) ([]byte, error)
- func Unmarshal(data []byte, out interface{}) error
- func UnmarshalArray(data []byte, v Array) error
- func UnmarshalBinary(data []byte, v *[]byte) error
- func UnmarshalBool(data []byte, v *bool) error
- func UnmarshalExtension(data []byte, v Extension) error
- func UnmarshalFloat32(data []byte, v *float32) error
- func UnmarshalFloat64(data []byte, v *float64) error
- func UnmarshalInt(data []byte, v *int) error
- func UnmarshalInt16(data []byte, v *int16) error
- func UnmarshalInt32(data []byte, v *int32) error
- func UnmarshalInt64(data []byte, v *int64) error
- func UnmarshalInt8(data []byte, v *int8) error
- func UnmarshalMap(data []byte, v Map) error
- func UnmarshalNullableArray(data []byte, v NullableArray) error
- func UnmarshalNullableBinary(data []byte, v **[]byte) error
- func UnmarshalNullableBool(data []byte, v **bool) error
- func UnmarshalNullableExtension(data []byte, v NullableExtension) error
- func UnmarshalNullableFloat32(data []byte, v **float32) error
- func UnmarshalNullableFloat64(data []byte, v **float64) error
- func UnmarshalNullableInt(data []byte, v **int) error
- func UnmarshalNullableInt16(data []byte, v **int16) error
- func UnmarshalNullableInt32(data []byte, v **int32) error
- func UnmarshalNullableInt64(data []byte, v **int64) error
- func UnmarshalNullableInt8(data []byte, v **int8) error
- func UnmarshalNullableMap(data []byte, v NullableMap) error
- func UnmarshalNullableString(data []byte, v **string) error
- func UnmarshalNullableTime(data []byte, v **time.Time) error
- func UnmarshalNullableUint(data []byte, v **uint) error
- func UnmarshalNullableUint16(data []byte, v **uint16) error
- func UnmarshalNullableUint32(data []byte, v **uint32) error
- func UnmarshalNullableUint64(data []byte, v **uint64) error
- func UnmarshalNullableUint8(data []byte, v **uint8) error
- func UnmarshalString(data []byte, v *string) error
- func UnmarshalTime(data []byte, v *time.Time) error
- func UnmarshalUint(data []byte, v *uint) error
- func UnmarshalUint16(data []byte, v *uint16) error
- func UnmarshalUint32(data []byte, v *uint32) error
- func UnmarshalUint64(data []byte, v *uint64) error
- func UnmarshalUint8(data []byte, v *uint8) error
- type Array
- type BinaryArray
- type BoolArray
- type Decoder
- func (d *Decoder) Decode(v interface{}) error
- func (d *Decoder) DecodeArray(v Array) error
- func (d *Decoder) DecodeBinary(v *[]byte) error
- func (d *Decoder) DecodeBool(v *bool) error
- func (d *Decoder) DecodeExtension(v Extension) error
- func (d *Decoder) DecodeFloat32(v *float32) error
- func (d *Decoder) DecodeFloat64(v *float64) error
- func (d *Decoder) DecodeInt(v *int) error
- func (d *Decoder) DecodeInt16(v *int16) error
- func (d *Decoder) DecodeInt32(v *int32) error
- func (d *Decoder) DecodeInt64(v *int64) error
- func (d *Decoder) DecodeInt8(v *int8) error
- func (d *Decoder) DecodeMap(v Map) error
- func (d *Decoder) DecodeNullableArray(v NullableArray) error
- func (d *Decoder) DecodeNullableBinary(v **[]byte) error
- func (d *Decoder) DecodeNullableBool(v **bool) error
- func (d *Decoder) DecodeNullableExtension(v NullableExtension) error
- func (d *Decoder) DecodeNullableFloat32(v **float32) error
- func (d *Decoder) DecodeNullableFloat64(v **float64) error
- func (d *Decoder) DecodeNullableInt(v **int) error
- func (d *Decoder) DecodeNullableInt16(v **int16) error
- func (d *Decoder) DecodeNullableInt32(v **int32) error
- func (d *Decoder) DecodeNullableInt64(v **int64) error
- func (d *Decoder) DecodeNullableInt8(v **int8) error
- func (d *Decoder) DecodeNullableMap(v NullableMap) error
- func (d *Decoder) DecodeNullableString(v **string) error
- func (d *Decoder) DecodeNullableTime(v **time.Time) error
- func (d *Decoder) DecodeNullableUint(v **uint) error
- func (d *Decoder) DecodeNullableUint16(v **uint16) error
- func (d *Decoder) DecodeNullableUint32(v **uint32) error
- func (d *Decoder) DecodeNullableUint64(v **uint64) error
- func (d *Decoder) DecodeNullableUint8(v **uint8) error
- func (d *Decoder) DecodeString(v *string) error
- func (d *Decoder) DecodeTime(v *time.Time) error
- func (d *Decoder) DecodeUint(v *uint) error
- func (d *Decoder) DecodeUint16(v *uint16) error
- func (d *Decoder) DecodeUint32(v *uint32) error
- func (d *Decoder) DecodeUint64(v *uint64) error
- func (d *Decoder) DecodeUint8(v *uint8) error
- type Encoder
- func (e *Encoder) Bytes() []byte
- func (e *Encoder) Error() error
- func (e *Encoder) PutArray(a Array) (err error)
- func (e *Encoder) PutBinary(v []byte) (err error)
- func (e *Encoder) PutBool(v bool) (err error)
- func (e *Encoder) PutExtension(ext Extension) (err error)
- func (e *Encoder) PutFloat32(v float32) (err error)
- func (e *Encoder) PutFloat64(v float64) (err error)
- func (e *Encoder) PutInt(v int) (err error)
- func (e *Encoder) PutInt16(v int16) (err error)
- func (e *Encoder) PutInt32(v int32) (err error)
- func (e *Encoder) PutInt64(v int64) (err error)
- func (e *Encoder) PutInt8(v int8) (err error)
- func (e *Encoder) PutMap(o Map) (err error)
- func (e *Encoder) PutString(v string) (err error)
- func (e *Encoder) PutTime(t time.Time) (err error)
- func (e *Encoder) PutUint(v uint) (err error)
- func (e *Encoder) PutUint16(v uint16) (err error)
- func (e *Encoder) PutUint32(v uint32) (err error)
- func (e *Encoder) PutUint64(v uint64) (err error)
- func (e *Encoder) PutUint8(v uint8) (err error)
- func (e *Encoder) Reset() *Encoder
- type ErrUnexpectedByte
- type ErrUnexpectedExtensionType
- type ErrUnexpectedJSONToken
- type ErrUnknownKey
- type ErrUnregisteredExtension
- type ErrUnsupported
- type ErrUnsupportedType
- type Extension
- type Float32Array
- type Float64Array
- type Int16Array
- type Int32Array
- type Int64Array
- type Int8Array
- type IntArray
- type Map
- type Nullable
- type NullableArray
- type NullableExtension
- type NullableMap
- type StringArray
- type TimeArray
- type Uint16Array
- type Uint32Array
- type Uint64Array
- type UintArray
Constants ¶
const ( Nil = 0xC0 False = 0xC2 True = 0xC3 Uint8 = 0xCC Uint16 = 0xCD Uint32 = 0xCE Uint64 = 0xCF Int8 = 0xD0 Int16 = 0xD1 Int32 = 0xD2 Int64 = 0xD3 Float32 = 0xCA Float64 = 0xCB String8 = 0xD9 String16 = 0xDA String32 = 0xDB Binary8 = 0xC4 Binary16 = 0xC5 Binary32 = 0xC6 Array16 = 0xDC Array32 = 0xDD Map16 = 0xDE Map32 = 0xDF Fixext1 = 0xD4 Fixext2 = 0xD5 Fixext4 = 0xD6 Fixext8 = 0xD7 Fixext16 = 0xD8 Ext8 = 0xC7 Ext16 = 0xC8 Ext32 = 0xC9 TimestampExt = -1 )
Variables ¶
var ( ErrTooLongString = errors.New("msgpack: string is too long") ErrTooLongBinary = errors.New("msgpack: binary is too long") ErrTooBigMap = errors.New("msgpack: map is too big") ErrTooBigExtension = errors.New("msgpack: extension is too big") ErrUnexpectedEOF = errors.New("msgpack: unexpected EOF") ErrNoReader = errors.New("msgpack: reader is nil") ErrDecodeNil = errors.New("msgpack: nil value was passed") ErrInvalidTime = errors.New("msgpack: invalid time") )
Functions ¶
func MarshalArray ¶
MarshalArray returns array value as msgpack format.
func MarshalBinary ¶
MarshalBinary returns binary value as msgpack format.
func MarshalBool ¶
MarshalBool returns bool value as msgpack format.
func MarshalExtension ¶
MarshalExtension returns extension value as msgpack format.
func MarshalFloat32 ¶
MarshalFloat32 returns float32 value as msgpack format.
func MarshalFloat64 ¶
MarshalFloat64 returns float64 value as msgpack format.
func MarshalInt ¶
MarshalInt returns int value as msgpack format.
func MarshalInt16 ¶
MarshalInt16 returns int16 value as msgpack format.
func MarshalInt32 ¶
MarshalInt32 returns int32 value as msgpack format.
func MarshalInt64 ¶
MarshalInt64 returns int64 value as msgpack format.
func MarshalInt8 ¶
MarshalInt8 returns int8 value as msgpack format.
func MarshalMap ¶
MarshalMap returns map value as msgpack format.
func MarshalString ¶
MarshalString returns string value as msgpack format.
func MarshalTime ¶
MarshalTime returns time.Time value as msgpack format.
func MarshalUint ¶
MarshalUint returns uint value as msgpack format.
func MarshalUint16 ¶
MarshalUint16 returns uint16 value as msgpack format.
func MarshalUint32 ¶
MarshalUint32 returns uint32 value as msgpack format.
func MarshalUint64 ¶
MarshalUint64 returns uint64 value as msgpack format.
func MarshalUint8 ¶
MarshalUint8 returns uint64 value as msgpack format.
func UnmarshalArray ¶
func UnmarshalBinary ¶
func UnmarshalBool ¶
func UnmarshalExtension ¶
func UnmarshalFloat32 ¶
func UnmarshalFloat64 ¶
func UnmarshalInt ¶
func UnmarshalInt16 ¶
func UnmarshalInt32 ¶
func UnmarshalInt64 ¶
func UnmarshalInt8 ¶
func UnmarshalMap ¶
func UnmarshalNullableArray ¶
func UnmarshalNullableArray(data []byte, v NullableArray) error
func UnmarshalNullableBinary ¶
func UnmarshalNullableBool ¶
func UnmarshalNullableExtension ¶
func UnmarshalNullableExtension(data []byte, v NullableExtension) error
func UnmarshalNullableInt ¶
func UnmarshalNullableInt16 ¶
func UnmarshalNullableInt32 ¶
func UnmarshalNullableInt64 ¶
func UnmarshalNullableInt8 ¶
func UnmarshalNullableMap ¶
func UnmarshalNullableMap(data []byte, v NullableMap) error
func UnmarshalNullableString ¶
func UnmarshalNullableUint ¶
func UnmarshalNullableUint16 ¶
func UnmarshalNullableUint32 ¶
func UnmarshalNullableUint64 ¶
func UnmarshalNullableUint8 ¶
func UnmarshalString ¶
func UnmarshalUint ¶
func UnmarshalUint16 ¶
func UnmarshalUint32 ¶
func UnmarshalUint64 ¶
func UnmarshalUint8 ¶
Types ¶
type BinaryArray ¶
type BinaryArray [][]byte
func (*BinaryArray) Length ¶
func (a *BinaryArray) Length() uint32
func (*BinaryArray) MarshalMsgpackArray ¶
func (a *BinaryArray) MarshalMsgpackArray(e *Encoder, i int) error
func (*BinaryArray) UnmarshalMsgpackArray ¶
func (a *BinaryArray) UnmarshalMsgpackArray(d *Decoder, l int) error
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewBytesDecoder ¶
func (*Decoder) DecodeArray ¶
func (*Decoder) DecodeBinary ¶
func (*Decoder) DecodeBool ¶
func (*Decoder) DecodeExtension ¶
func (*Decoder) DecodeFloat32 ¶
func (*Decoder) DecodeFloat64 ¶
func (*Decoder) DecodeInt16 ¶
func (*Decoder) DecodeInt32 ¶
func (*Decoder) DecodeInt64 ¶
func (*Decoder) DecodeInt8 ¶
func (*Decoder) DecodeNullableArray ¶
func (d *Decoder) DecodeNullableArray(v NullableArray) error
func (*Decoder) DecodeNullableBinary ¶
func (*Decoder) DecodeNullableBool ¶
func (*Decoder) DecodeNullableExtension ¶
func (d *Decoder) DecodeNullableExtension(v NullableExtension) error
func (*Decoder) DecodeNullableFloat32 ¶
func (*Decoder) DecodeNullableFloat64 ¶
func (*Decoder) DecodeNullableInt ¶
func (*Decoder) DecodeNullableInt16 ¶
func (*Decoder) DecodeNullableInt32 ¶
func (*Decoder) DecodeNullableInt64 ¶
func (*Decoder) DecodeNullableInt8 ¶
func (*Decoder) DecodeNullableMap ¶
func (d *Decoder) DecodeNullableMap(v NullableMap) error
func (*Decoder) DecodeNullableString ¶
func (*Decoder) DecodeNullableUint ¶
func (*Decoder) DecodeNullableUint16 ¶
func (*Decoder) DecodeNullableUint32 ¶
func (*Decoder) DecodeNullableUint64 ¶
func (*Decoder) DecodeNullableUint8 ¶
func (*Decoder) DecodeString ¶
func (*Decoder) DecodeUint ¶
func (*Decoder) DecodeUint16 ¶
func (*Decoder) DecodeUint32 ¶
func (*Decoder) DecodeUint64 ¶
func (*Decoder) DecodeUint8 ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder writes msgpack formatted variable to writer.
func (*Encoder) PutExtension ¶
PutExtension puts extension variable to encoder.
func (*Encoder) PutFloat32 ¶
PutFloat32 puts float32 variable to encoder.
func (*Encoder) PutFloat64 ¶
PutFloat64 puts float64 variable to encoder.
type ErrUnexpectedByte ¶
func (*ErrUnexpectedByte) Error ¶
func (e *ErrUnexpectedByte) Error() string
type ErrUnexpectedExtensionType ¶
type ErrUnexpectedExtensionType struct {
Type int8
}
func (*ErrUnexpectedExtensionType) Error ¶
func (e *ErrUnexpectedExtensionType) Error() string
type ErrUnexpectedJSONToken ¶
func (*ErrUnexpectedJSONToken) Error ¶
func (e *ErrUnexpectedJSONToken) Error() string
type ErrUnknownKey ¶
type ErrUnknownKey struct {
Key string
}
func (*ErrUnknownKey) Error ¶
func (e *ErrUnknownKey) Error() string
type ErrUnregisteredExtension ¶
type ErrUnregisteredExtension struct {
Type int8
}
func (*ErrUnregisteredExtension) Error ¶
func (e *ErrUnregisteredExtension) Error() string
type ErrUnsupported ¶
type ErrUnsupported struct {
// contains filtered or unexported fields
}
func (*ErrUnsupported) Error ¶
func (e *ErrUnsupported) Error() string
type ErrUnsupportedType ¶
func (*ErrUnsupportedType) Error ¶
func (e *ErrUnsupportedType) Error() string
type Extension ¶
type Extension interface { ExtensionType() int8 MarshalMsgpackExtension() []byte UnmarshalMsgpackExtension(p []byte) error }
Extension is an interface for application-specific type.
type Float32Array ¶
type Float32Array []float32
func (*Float32Array) Length ¶
func (a *Float32Array) Length() uint32
func (*Float32Array) MarshalMsgpackArray ¶
func (a *Float32Array) MarshalMsgpackArray(e *Encoder, i int) error
func (*Float32Array) UnmarshalMsgpackArray ¶
func (a *Float32Array) UnmarshalMsgpackArray(d *Decoder, l int) error
type Float64Array ¶
type Float64Array []float64
func (*Float64Array) Length ¶
func (a *Float64Array) Length() uint32
func (*Float64Array) MarshalMsgpackArray ¶
func (a *Float64Array) MarshalMsgpackArray(e *Encoder, i int) error
func (*Float64Array) UnmarshalMsgpackArray ¶
func (a *Float64Array) UnmarshalMsgpackArray(d *Decoder, l int) error
type Int16Array ¶
type Int16Array []int16
func (*Int16Array) Length ¶
func (a *Int16Array) Length() uint32
func (*Int16Array) MarshalMsgpackArray ¶
func (a *Int16Array) MarshalMsgpackArray(e *Encoder, i int) error
func (*Int16Array) UnmarshalMsgpackArray ¶
func (a *Int16Array) UnmarshalMsgpackArray(d *Decoder, l int) error
type Int32Array ¶
type Int32Array []int32
func (*Int32Array) Length ¶
func (a *Int32Array) Length() uint32
func (*Int32Array) MarshalMsgpackArray ¶
func (a *Int32Array) MarshalMsgpackArray(e *Encoder, i int) error
func (*Int32Array) UnmarshalMsgpackArray ¶
func (a *Int32Array) UnmarshalMsgpackArray(d *Decoder, l int) error
type Int64Array ¶
type Int64Array []int64
func (*Int64Array) Length ¶
func (a *Int64Array) Length() uint32
func (*Int64Array) MarshalMsgpackArray ¶
func (a *Int64Array) MarshalMsgpackArray(e *Encoder, i int) error
func (*Int64Array) UnmarshalMsgpackArray ¶
func (a *Int64Array) UnmarshalMsgpackArray(d *Decoder, l int) error
type Map ¶
type Map interface { MarshalMsgpackMap(e *Encoder, key string) error UnmarshalMsgpackMap(d *Decoder, key string) error Fields() []string }
Map represents key-value pairs of objects
type Nullable ¶
type Nullable interface {
UnmarshalMsgpackNull() error
}
Nullable represents an object that can be nil.
type NullableArray ¶
type NullableExtension ¶
NullableExtension is an extension that can be nil.
type NullableMap ¶
NullableMap is a map that can be nil.
type StringArray ¶
type StringArray []string
func (*StringArray) Length ¶
func (a *StringArray) Length() uint32
func (*StringArray) MarshalMsgpackArray ¶
func (a *StringArray) MarshalMsgpackArray(e *Encoder, i int) error
func (*StringArray) UnmarshalMsgpackArray ¶
func (a *StringArray) UnmarshalMsgpackArray(d *Decoder, l int) error
type TimeArray ¶
func (*TimeArray) MarshalMsgpackArray ¶
type Uint16Array ¶
type Uint16Array []uint16
func (*Uint16Array) Length ¶
func (a *Uint16Array) Length() uint32
func (*Uint16Array) MarshalMsgpackArray ¶
func (a *Uint16Array) MarshalMsgpackArray(e *Encoder, i int) error
func (*Uint16Array) UnmarshalMsgpackArray ¶
func (a *Uint16Array) UnmarshalMsgpackArray(d *Decoder, l int) error
type Uint32Array ¶
type Uint32Array []uint32
func (*Uint32Array) Length ¶
func (a *Uint32Array) Length() uint32
func (*Uint32Array) MarshalMsgpackArray ¶
func (a *Uint32Array) MarshalMsgpackArray(e *Encoder, i int) error
func (*Uint32Array) UnmarshalMsgpackArray ¶
func (a *Uint32Array) UnmarshalMsgpackArray(d *Decoder, l int) error
type Uint64Array ¶
type Uint64Array []uint64
func (*Uint64Array) Length ¶
func (a *Uint64Array) Length() uint32
func (*Uint64Array) MarshalMsgpackArray ¶
func (a *Uint64Array) MarshalMsgpackArray(e *Encoder, i int) error
func (*Uint64Array) UnmarshalMsgpackArray ¶
func (a *Uint64Array) UnmarshalMsgpackArray(d *Decoder, l int) error
Source Files
¶
- array.go
- const.go
- decode.go
- decode_array.go
- decode_binary.go
- decode_bool.go
- decode_ext.go
- decode_float32.go
- decode_float64.go
- decode_int.go
- decode_int16.go
- decode_int32.go
- decode_int64.go
- decode_int8.go
- decode_map.go
- decode_string.go
- decode_time.go
- decode_uint.go
- decode_uint16.go
- decode_uint32.go
- decode_uint64.go
- decode_uint8.go
- encode.go
- encode_array.go
- encode_binary.go
- encode_bool.go
- encode_ext.go
- encode_float32.go
- encode_float64.go
- encode_int.go
- encode_int16.go
- encode_int32.go
- encode_int64.go
- encode_int8.go
- encode_map.go
- encode_string.go
- encode_time.go
- encode_uint.go
- encode_uint16.go
- encode_uint32.go
- encode_uint64.go
- encode_uint8.go
- errors.go
- extension.go
- map.go
- nullable.go
- time.go
- util.go