本文整理汇总了Golang中github.com/tinylib/msgp/msgp.Reader.ReadUint64方法的典型用法代码示例。如果您正苦于以下问题:Golang Reader.ReadUint64方法的具体用法?Golang Reader.ReadUint64怎么用?Golang Reader.ReadUint64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/tinylib/msgp/msgp.Reader
的用法示例。
在下文中一共展示了Reader.ReadUint64方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: 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
}
示例2: next
func (h *ConnectionHandler) next(r *msgp.Reader) (hasHeaders bool, channel uint64, c uint64, err error) {
var sz uint32
sz, err = r.ReadArrayHeader()
if err != nil {
return
}
hasHeaders = sz == 4
channel, err = r.ReadUint64()
if err != nil {
return
}
c, err = r.ReadUint64()
if err != nil {
return
}
return
}
示例3: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Message) 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 "id":
z.ID, err = dc.ReadUint64()
if err != nil {
return
}
case "fn":
z.Func, err = dc.ReadString()
if err != nil {
return
}
case "args":
err = z.Args.DecodeMsg(dc)
if err != nil {
return
}
case "result":
err = z.Result.DecodeMsg(dc)
if err != nil {
return
}
case "error":
if dc.IsNil() {
err = dc.ReadNil()
if err != nil {
return
}
z.Error = nil
} else {
if z.Error == nil {
z.Error = new(Error)
}
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.Error.Msg, err = dc.ReadString()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}