本文整理汇总了Golang中github.com/tinylib/msgp/msgp.Reader.ReadBool方法的典型用法代码示例。如果您正苦于以下问题:Golang Reader.ReadBool方法的具体用法?Golang Reader.ReadBool怎么用?Golang Reader.ReadBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/tinylib/msgp/msgp.Reader
的用法示例。
在下文中一共展示了Reader.ReadBool方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *MethodT) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zcxo uint32
zcxo, err = dc.ReadMapHeader()
if err != nil {
return
}
for zcxo > 0 {
zcxo--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "MethodId":
z.MethodId, err = dc.ReadInt64()
if err != nil {
return
}
case "Name":
z.Name, err = dc.ReadString()
if err != nil {
return
}
case "Inputs":
err = z.Inputs.DecodeMsg(dc)
if err != nil {
return
}
case "Returns":
err = z.Returns.DecodeMsg(dc)
if err != nil {
return
}
case "Deprecated":
z.Deprecated, err = dc.ReadBool()
if err != nil {
return
}
case "Comment":
z.Comment, err = dc.ReadString()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例2: 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
}
示例3: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *roaringArray) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zlqf uint32
zlqf, err = dc.ReadMapHeader()
if err != nil {
return
}
for zlqf > 0 {
zlqf--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "keys":
var zdaf uint32
zdaf, err = dc.ReadArrayHeader()
if err != nil {
return
}
if cap(z.keys) >= int(zdaf) {
z.keys = (z.keys)[:zdaf]
} else {
z.keys = make([]uint16, zdaf)
}
for zhct := range z.keys {
z.keys[zhct], err = dc.ReadUint16()
if err != nil {
return
}
}
case "needCopyOnWrite":
var zpks uint32
zpks, err = dc.ReadArrayHeader()
if err != nil {
return
}
if cap(z.needCopyOnWrite) >= int(zpks) {
z.needCopyOnWrite = (z.needCopyOnWrite)[:zpks]
} else {
z.needCopyOnWrite = make([]bool, zpks)
}
for zcua := range z.needCopyOnWrite {
z.needCopyOnWrite[zcua], err = dc.ReadBool()
if err != nil {
return
}
}
case "copyOnWrite":
z.copyOnWrite, err = dc.ReadBool()
if err != nil {
return
}
case "conserz":
var zjfb uint32
zjfb, err = dc.ReadArrayHeader()
if err != nil {
return
}
if cap(z.conserz) >= int(zjfb) {
z.conserz = (z.conserz)[:zjfb]
} else {
z.conserz = make([]containerSerz, zjfb)
}
for zxhx := range z.conserz {
var zcxo uint32
zcxo, err = dc.ReadMapHeader()
if err != nil {
return
}
for zcxo > 0 {
zcxo--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "t":
{
var zeff uint8
zeff, err = dc.ReadUint8()
z.conserz[zxhx].t = contype(zeff)
}
if err != nil {
return
}
case "r":
err = z.conserz[zxhx].r.DecodeMsg(dc)
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
//.........这里部分代码省略.........
示例4: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Incident) 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 "event_name":
z.EventName, err = dc.ReadBytes(z.EventName)
if err != nil {
return
}
case "time":
z.Time, err = dc.ReadInt64()
if err != nil {
return
}
case "id":
z.Id, err = dc.ReadInt64()
if err != nil {
return
}
case "active":
z.Active, err = dc.ReadBool()
if err != nil {
return
}
case "escalation":
z.Escalation, err = dc.ReadString()
if err != nil {
return
}
case "description":
z.Description, err = dc.ReadString()
if err != nil {
return
}
case "policy":
z.Policy, err = dc.ReadString()
if err != nil {
return
}
case "Status":
z.Status, err = dc.ReadInt()
if err != nil {
return
}
case "Event":
err = z.Event.DecodeMsg(dc)
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}