Documentation
¶
Index ¶
- Constants
- Variables
- func Int64FromInterface(v interface{}) int64
- func IntFromInterface(v interface{}) int
- func Uint64FromInterface(v interface{}) uint64
- type Codec
- type Decoder
- type DecoderIMv1
- type DecoderIMv2
- type DecoderJSONv1
- type DecoderMemory
- type Encoder
- type EncoderIMv1
- type EncoderIMv2
- type EncoderJSONv1
- type EncoderMemory
- type IMData
- type IMMap
- type IMMapReader
- func (receiver IMMapReader) BoolValueOf(key interface{}) bool
- func (receiver IMMapReader) FloatValueOf(key interface{}, def float64) float64
- func (receiver IMMapReader) IntValueOf(key interface{}, def int64) int64
- func (receiver IMMapReader) StrValueOf(key interface{}, def string) string
- func (receiver IMMapReader) TryReadValue(key interface{}) interface{}
- func (receiver IMMapReader) UintValueOf(key interface{}, def uint64) uint64
- type IMSlice
- type IMSliceReader
- func (receiver IMSliceReader) BoolValueOf(index int) bool
- func (receiver IMSliceReader) FloatValueOf(index int, def float64) float64
- func (receiver IMSliceReader) IntValueOf(index int, def int64) int64
- func (receiver IMSliceReader) MySQLStrValueOf(index int, def string) string
- func (receiver IMSliceReader) StrValueOf(index int, def string) string
- func (receiver IMSliceReader) UintValueOf(index int, def uint64) uint64
- type IMStrMap
- type IntermediateValue
- func (receiver IntermediateValue) Bool() bool
- func (receiver IntermediateValue) Float32() float32
- func (receiver IntermediateValue) Float64() float64
- func (receiver IntermediateValue) Int() int
- func (receiver IntermediateValue) Int64() int64
- func (receiver IntermediateValue) Int64WithDefault(def int64) int64
- func (receiver IntermediateValue) IntWithDefault(def int) int
- func (receiver IntermediateValue) Map() map[interface{}]interface{}
- func (receiver IntermediateValue) Slice() []interface{}
- func (receiver IntermediateValue) String() string
Constants ¶
View Source
const ( ProtocolMemory = 0x0 ProtocolIM = 0x1 ProtocolJSON = 0x2 ProtocolReserved = 0xF )
View Source
const ( IMDataHeaderLength = 1 + 4 IMDataTypeUnknown = 0 IMDataTypeInt = 1 IMDataTypeInt64 = 2 IMDataTypeStr = 3 IMDataTypeFloat = 4 IMDataTypeBool = 5 IMDataTypeDouble = 6 IMDataTypeMap = 7 IMDataTypeList = 8 IMDataTypeBuffer = 9 IMDataTypePBuffer = 10 IMDataTypeMemory = 11 IMDataTypePyStr = 12 IMDataTypeLong = 13 IMDataTypeShort = 14 IMDataTypeChar = 15 )
View Source
const ( IMV2DataTypeUnknown = 0 IMV2DataTypeInt8 = 1 IMV2DataTypeUint8 = 2 IMV2DataTypeInt16 = 3 IMV2DataTypeUint16 = 4 IMV2DataTypeInt32 = 5 IMV2DataTypeUint32 = 6 IMV2DataTypeInt64 = 7 IMV2DataTypeUint64 = 8 IMV2DataTypeFloat32 = 9 IMV2DataTypeFloat64 = 10 IMV2DataTypeReserved = 11 IMV2DataTypeTrue = 12 IMV2DataTypeFalse = 13 IMV2DataTypeString = 14 IMV2DataTypeBytes = 15 IMV2DataTypeMap = 16 IMV2DataTypeList = 17 IMV2DataTypeJSBigNumber = 18 )
Variables ¶
View Source
var CodecIMv1 = &codecIMv1
View Source
var CodecIMv2 = &codecIMv2
View Source
var CodecJSONv1 = &codecJSONv1
View Source
var CodecMemoryV1 = &codecMemoryV1
Functions ¶
func Int64FromInterface ¶
func Int64FromInterface(v interface{}) int64
func IntFromInterface ¶
func IntFromInterface(v interface{}) int
func Uint64FromInterface ¶
func Uint64FromInterface(v interface{}) uint64
Types ¶
type DecoderIMv1 ¶
type DecoderIMv1 struct {
// contains filtered or unexported fields
}
Intermediate V1 struct
|header|data| header(5 byte) =>> |type|size| type: 1 byte size: 4 byte data =>> if data's type is map or list, size is elements count of data otherwise, size is memory length of data
func (*DecoderIMv1) SetByteOrder ¶
func (receiver *DecoderIMv1) SetByteOrder(byteOrder binary.ByteOrder)
type DecoderIMv2 ¶
type DecoderIMv2 struct {
// contains filtered or unexported fields
}
func (*DecoderIMv2) SetByteOrder ¶
func (receiver *DecoderIMv2) SetByteOrder(byteOrder binary.ByteOrder)
type DecoderJSONv1 ¶
type DecoderJSONv1 struct { }
func (DecoderJSONv1) Decode ¶
func (receiver DecoderJSONv1) Decode(raw []byte) (error, IMData, []byte)
func (*DecoderJSONv1) SetByteOrder ¶
func (receiver *DecoderJSONv1) SetByteOrder(binary.ByteOrder)
type DecoderMemory ¶
type DecoderMemory struct{}
func (DecoderMemory) Decode ¶
func (receiver DecoderMemory) Decode(raw []byte) (error, IMData, []byte)
func (*DecoderMemory) SetByteOrder ¶
func (receiver *DecoderMemory) SetByteOrder(binary.ByteOrder)
type EncoderIMv1 ¶
type EncoderIMv1 struct {
// contains filtered or unexported fields
}
func (*EncoderIMv1) SetByteOrder ¶
func (receiver *EncoderIMv1) SetByteOrder(byteOrder binary.ByteOrder)
type EncoderIMv2 ¶
type EncoderIMv2 struct {
// contains filtered or unexported fields
}
func (*EncoderIMv2) SetByteOrder ¶
func (receiver *EncoderIMv2) SetByteOrder(byteOrder binary.ByteOrder)
type EncoderJSONv1 ¶
type EncoderJSONv1 struct { }
func (*EncoderJSONv1) SetByteOrder ¶
func (receiver *EncoderJSONv1) SetByteOrder(binary.ByteOrder)
type EncoderMemory ¶
type EncoderMemory struct{}
func (*EncoderMemory) SetByteOrder ¶
func (receiver *EncoderMemory) SetByteOrder(binary.ByteOrder)
type IMMapReader ¶
type IMMapReader struct {
Map IMMap
}
func CreateMapReader ¶
func CreateMapReader(m IMMap) *IMMapReader
func (IMMapReader) BoolValueOf ¶
func (receiver IMMapReader) BoolValueOf(key interface{}) bool
func (IMMapReader) FloatValueOf ¶
func (receiver IMMapReader) FloatValueOf(key interface{}, def float64) float64
func (IMMapReader) IntValueOf ¶
func (receiver IMMapReader) IntValueOf(key interface{}, def int64) int64
func (IMMapReader) StrValueOf ¶
func (receiver IMMapReader) StrValueOf(key interface{}, def string) string
func (IMMapReader) TryReadValue ¶
func (receiver IMMapReader) TryReadValue(key interface{}) interface{}
func (IMMapReader) UintValueOf ¶
func (receiver IMMapReader) UintValueOf(key interface{}, def uint64) uint64
type IMSliceReader ¶
type IMSliceReader struct {
List IMSlice
}
func CreateSliceReader ¶
func CreateSliceReader(m IMSlice) *IMSliceReader
func (IMSliceReader) BoolValueOf ¶
func (receiver IMSliceReader) BoolValueOf(index int) bool
func (IMSliceReader) FloatValueOf ¶
func (receiver IMSliceReader) FloatValueOf(index int, def float64) float64
func (IMSliceReader) IntValueOf ¶
func (receiver IMSliceReader) IntValueOf(index int, def int64) int64
func (IMSliceReader) MySQLStrValueOf ¶
func (receiver IMSliceReader) MySQLStrValueOf(index int, def string) string
func (IMSliceReader) StrValueOf ¶
func (receiver IMSliceReader) StrValueOf(index int, def string) string
func (IMSliceReader) UintValueOf ¶
func (receiver IMSliceReader) UintValueOf(index int, def uint64) uint64
type IntermediateValue ¶
type IntermediateValue struct {
// contains filtered or unexported fields
}
func CreateIntermediateValue ¶
func CreateIntermediateValue(raw interface{}) *IntermediateValue
func (IntermediateValue) Bool ¶
func (receiver IntermediateValue) Bool() bool
func (IntermediateValue) Float32 ¶
func (receiver IntermediateValue) Float32() float32
func (IntermediateValue) Float64 ¶
func (receiver IntermediateValue) Float64() float64
func (IntermediateValue) Int ¶
func (receiver IntermediateValue) Int() int
func (IntermediateValue) Int64 ¶
func (receiver IntermediateValue) Int64() int64
func (IntermediateValue) Int64WithDefault ¶
func (receiver IntermediateValue) Int64WithDefault(def int64) int64
func (IntermediateValue) IntWithDefault ¶
func (receiver IntermediateValue) IntWithDefault(def int) int
func (IntermediateValue) Map ¶
func (receiver IntermediateValue) Map() map[interface{}]interface{}
func (IntermediateValue) Slice ¶
func (receiver IntermediateValue) Slice() []interface{}
func (IntermediateValue) String ¶
func (receiver IntermediateValue) String() string
Click to show internal directories.
Click to hide internal directories.