当前位置: 首页>>代码示例>>Golang>>正文


Golang Reader.ReadMapHeader方法代码示例

本文整理汇总了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
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:35,代码来源:rle_gen.go

示例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
}
开发者ID:sztanpet,项目名称:bimpc,代码行数:30,代码来源:mpc_gen.go

示例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
}
开发者ID:glycerine,项目名称:zebra,代码行数:30,代码来源:zebra_gen.go

示例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
}
开发者ID:Dieterbe,项目名称:hdrhistogramtest,代码行数:57,代码来源:test_gen.go

示例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
}
开发者ID:andyleap,项目名称:gencode,代码行数:55,代码来源:test.schema.gen_gen.go

示例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
}
开发者ID:darciopacifico,项目名称:enablecache,代码行数:55,代码来源:manager_gen.go

示例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
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:47,代码来源:bitmapcontainer_gen.go

示例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
}
开发者ID:ZloyDyadka,项目名称:socketcrutch,代码行数:45,代码来源:packet_gen.go

示例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
}
开发者ID:glycerine,项目名称:zygomys,代码行数:45,代码来源:demo_go_structs_gen.go

示例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
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:42,代码来源:arraycontainer_gen.go

示例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
}
开发者ID:mengzhuo,项目名称:zerorpc-golang,代码行数:40,代码来源:protocal_gen.go

示例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
}
开发者ID:sztanpet,项目名称:bimpc,代码行数:40,代码来源:main_gen.go

示例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
}
开发者ID:glycerine,项目名称:tmframe,代码行数:40,代码来源:date_gen.go

示例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
}
开发者ID:darciopacifico,项目名称:enablecache,代码行数:40,代码来源:schema_gen.go

示例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
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:39,代码来源:roaringarray_gen.go


注:本文中的github.com/tinylib/msgp/msgp.Reader.ReadMapHeader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。