本文整理汇总了Golang中github.com/tinylib/msgp/msgp.Reader.ReadMapHeader方法的典型用法代码示例。如果您正苦于以下问题:Golang Reader.ReadMapHeader方法的具体用法?Golang Reader.ReadMapHeader怎么用?Golang Reader.ReadMapHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/tinylib/msgp/msgp.Reader
的用法示例。
在下文中一共展示了Reader.ReadMapHeader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *interval32) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zeff uint32
zeff, err = dc.ReadMapHeader()
if err != nil {
return
}
for zeff > 0 {
zeff--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "start":
z.start, err = dc.ReadUint32()
if err != nil {
return
}
case "last":
z.last, err = dc.ReadUint32()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例2: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Error) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var isz uint32
isz, err = dc.ReadMapHeader()
if err != nil {
return
}
for isz > 0 {
isz--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "msg":
z.Msg, err = dc.ReadString()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例3: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *StructInstance) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zqke uint32
zqke, err = dc.ReadMapHeader()
if err != nil {
return
}
for zqke > 0 {
zqke--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "StructId":
z.StructId, err = dc.ReadInt64()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例4: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Snap) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var isz uint32
isz, err = dc.ReadMapHeader()
if err != nil {
return
}
for isz > 0 {
isz--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "LowestTrackableValue":
z.LowestTrackableValue, err = dc.ReadInt64()
if err != nil {
return
}
case "HighestTrackableValue":
z.HighestTrackableValue, err = dc.ReadInt64()
if err != nil {
return
}
case "SignificantFigures":
z.SignificantFigures, err = dc.ReadInt64()
if err != nil {
return
}
case "Counts":
var xsz uint32
xsz, err = dc.ReadArrayHeader()
if err != nil {
return
}
if cap(z.Counts) >= int(xsz) {
z.Counts = z.Counts[:xsz]
} else {
z.Counts = make([]int64, xsz)
}
for xvk := range z.Counts {
z.Counts[xvk], err = dc.ReadInt64()
if err != nil {
return
}
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例5: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *A) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var isz uint32
isz, err = dc.ReadMapHeader()
if err != nil {
return
}
for isz > 0 {
isz--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "Name":
z.Name, err = dc.ReadString()
if err != nil {
return
}
case "BirthDay":
z.BirthDay, err = dc.ReadInt64()
if err != nil {
return
}
case "Phone":
z.Phone, err = dc.ReadString()
if err != nil {
return
}
case "Siblings":
z.Siblings, err = dc.ReadInt64()
if err != nil {
return
}
case "Spouse":
z.Spouse, err = dc.ReadUint8()
if err != nil {
return
}
case "Money":
z.Money, err = dc.ReadFloat64()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例6: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *CacheRegistry) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var xvk uint32
xvk, err = dc.ReadMapHeader()
if err != nil {
return
}
for xvk > 0 {
xvk--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "CacheKey":
z.CacheKey, err = dc.ReadString()
if err != nil {
return
}
case "Payload":
z.Payload, err = dc.ReadIntf()
if err != nil {
return
}
case "StoreTTL":
z.StoreTTL, err = dc.ReadFloat64()
if err != nil {
return
}
case "CacheTime":
z.CacheTime, err = dc.ReadTime()
if err != nil {
return
}
case "HasValue":
z.HasValue, err = dc.ReadBool()
if err != nil {
return
}
case "TypeName":
z.TypeName, err = dc.ReadString()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例7: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *bitmapContainer) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zbzg uint32
zbzg, err = dc.ReadMapHeader()
if err != nil {
return
}
for zbzg > 0 {
zbzg--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "cardinality":
z.cardinality, err = dc.ReadInt()
if err != nil {
return
}
case "bitmap":
var zbai uint32
zbai, err = dc.ReadArrayHeader()
if err != nil {
return
}
if cap(z.bitmap) >= int(zbai) {
z.bitmap = (z.bitmap)[:zbai]
} else {
z.bitmap = make([]uint64, zbai)
}
for zxvk := range z.bitmap {
z.bitmap[zxvk], err = dc.ReadUint64()
if err != nil {
return
}
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例8: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Packet) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var isz uint32
isz, err = dc.ReadMapHeader()
if err != nil {
return
}
for isz > 0 {
isz--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "type":
z.pType, err = dc.ReadByte()
if err != nil {
return
}
case "id":
z.id, err = dc.ReadInt()
if err != nil {
return
}
case "event":
z.eventName, err = dc.ReadString()
if err != nil {
return
}
case "payload":
z.payload, err = dc.ReadBytes(z.payload)
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例9: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Weather) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var isz uint32
isz, err = dc.ReadMapHeader()
if err != nil {
return
}
for isz > 0 {
isz--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "time":
z.Time, err = dc.ReadTime()
if err != nil {
return
}
case "size":
z.Size, err = dc.ReadInt64()
if err != nil {
return
}
case "type":
z.Type, err = dc.ReadString()
if err != nil {
return
}
case "details":
z.Details, err = dc.ReadBytes(z.Details)
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例10: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *arrayContainer) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zbzg uint32
zbzg, err = dc.ReadMapHeader()
if err != nil {
return
}
for zbzg > 0 {
zbzg--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "content":
var zbai uint32
zbai, err = dc.ReadArrayHeader()
if err != nil {
return
}
if cap(z.content) >= int(zbai) {
z.content = (z.content)[:zbai]
} else {
z.content = make([]uint16, zbai)
}
for zxvk := range z.content {
z.content[zxvk], err = dc.ReadUint16()
if err != nil {
return
}
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例11: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *EventHeader) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var isz uint32
isz, err = dc.ReadMapHeader()
if err != nil {
return
}
for isz > 0 {
isz--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "message_id":
z.Id, err = dc.ReadString()
if err != nil {
return
}
case "v":
z.Version, err = dc.ReadInt()
if err != nil {
return
}
case "response_to":
z.ResponseTo, err = dc.ReadString()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例12: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Outgoing) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var isz uint32
isz, err = dc.ReadMapHeader()
if err != nil {
return
}
for isz > 0 {
isz--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "time":
z.Time, err = dc.ReadUint32()
if err != nil {
return
}
case "from":
z.From, err = dc.ReadString()
if err != nil {
return
}
case "message":
z.Message, err = dc.ReadString()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例13: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Date) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var isz uint32
isz, err = dc.ReadMapHeader()
if err != nil {
return
}
for isz > 0 {
isz--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "Year":
z.Year, err = dc.ReadInt()
if err != nil {
return
}
case "Month":
z.Month, err = dc.ReadInt()
if err != nil {
return
}
case "Day":
z.Day, err = dc.ReadInt()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例14: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Attribute) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var xvk uint32
xvk, err = dc.ReadMapHeader()
if err != nil {
return
}
for xvk > 0 {
xvk--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "Id":
z.Id, err = dc.ReadInt()
if err != nil {
return
}
case "Name":
z.Name, err = dc.ReadString()
if err != nil {
return
}
case "Value":
z.Value, err = dc.ReadString()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例15: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *containerSerz) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zxvk uint32
zxvk, err = dc.ReadMapHeader()
if err != nil {
return
}
for zxvk > 0 {
zxvk--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "t":
{
var zbzg uint8
zbzg, err = dc.ReadUint8()
z.t = contype(zbzg)
}
if err != nil {
return
}
case "r":
err = z.r.DecodeMsg(dc)
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}