本文整理汇总了Golang中github.com/tinylib/msgp/msgp.ReadMapHeaderBytes函数的典型用法代码示例。如果您正苦于以下问题:Golang ReadMapHeaderBytes函数的具体用法?Golang ReadMapHeaderBytes怎么用?Golang ReadMapHeaderBytes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ReadMapHeaderBytes函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Error) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "msg":
z.Msg, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:sztanpet,项目名称:bimpc,代码行数:31,代码来源:mpc_gen.go
示例2: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *interval32) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zrsw uint32
zrsw, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for zrsw > 0 {
zrsw--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "start":
z.start, bts, err = msgp.ReadUint32Bytes(bts)
if err != nil {
return
}
case "last":
z.last, bts, err = msgp.ReadUint32Bytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:36,代码来源:rle_gen.go
示例3: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *StructInstance) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zqyh uint32
zqyh, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for zqyh > 0 {
zqyh--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "StructId":
z.StructId, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:glycerine,项目名称:zebra,代码行数:31,代码来源:zebra_gen.go
示例4: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Snap) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "LowestTrackableValue":
z.LowestTrackableValue, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
case "HighestTrackableValue":
z.HighestTrackableValue, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
case "SignificantFigures":
z.SignificantFigures, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
case "Counts":
var xsz uint32
xsz, bts, err = msgp.ReadArrayHeaderBytes(bts)
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], bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:Dieterbe,项目名称:hdrhistogramtest,代码行数:58,代码来源:test_gen.go
示例5: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *A) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "Name":
z.Name, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "BirthDay":
z.BirthDay, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
case "Phone":
z.Phone, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "Siblings":
z.Siblings, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
case "Spouse":
z.Spouse, bts, err = msgp.ReadUint8Bytes(bts)
if err != nil {
return
}
case "Money":
z.Money, bts, err = msgp.ReadFloat64Bytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:andyleap,项目名称:gencode,代码行数:56,代码来源:test.schema.gen_gen.go
示例6: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *CacheRegistry) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var bzg uint32
bzg, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for bzg > 0 {
bzg--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "CacheKey":
z.CacheKey, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "Payload":
z.Payload, bts, err = msgp.ReadIntfBytes(bts)
if err != nil {
return
}
case "StoreTTL":
z.StoreTTL, bts, err = msgp.ReadFloat64Bytes(bts)
if err != nil {
return
}
case "CacheTime":
z.CacheTime, bts, err = msgp.ReadTimeBytes(bts)
if err != nil {
return
}
case "HasValue":
z.HasValue, bts, err = msgp.ReadBoolBytes(bts)
if err != nil {
return
}
case "TypeName":
z.TypeName, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:darciopacifico,项目名称:enablecache,代码行数:56,代码来源:manager_gen.go
示例7: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *ColorGroup) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "id":
z.Id, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
case "name":
z.Name, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "colors":
var xsz uint32
xsz, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
return
}
if cap(z.Colors) >= int(xsz) {
z.Colors = z.Colors[:xsz]
} else {
z.Colors = make([]string, xsz)
}
for xvk := range z.Colors {
z.Colors[xvk], bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:jameswei,项目名称:gosercomp,代码行数:53,代码来源:msgp_gen.go
示例8: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *bitmapContainer) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zcmr uint32
zcmr, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for zcmr > 0 {
zcmr--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "cardinality":
z.cardinality, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
case "bitmap":
var zajw uint32
zajw, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
return
}
if cap(z.bitmap) >= int(zajw) {
z.bitmap = (z.bitmap)[:zajw]
} else {
z.bitmap = make([]uint64, zajw)
}
for zxvk := range z.bitmap {
z.bitmap[zxvk], bts, err = msgp.ReadUint64Bytes(bts)
if err != nil {
return
}
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:48,代码来源:bitmapcontainer_gen.go
示例9: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Packet) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "type":
z.pType, bts, err = msgp.ReadByteBytes(bts)
if err != nil {
return
}
case "id":
z.id, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
case "event":
z.eventName, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "payload":
z.payload, bts, err = msgp.ReadBytesBytes(bts, z.payload)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:ZloyDyadka,项目名称:socketcrutch,代码行数:46,代码来源:packet_gen.go
示例10: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Weather) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "time":
z.Time, bts, err = msgp.ReadTimeBytes(bts)
if err != nil {
return
}
case "size":
z.Size, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
case "type":
z.Type, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "details":
z.Details, bts, err = msgp.ReadBytesBytes(bts, z.Details)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:glycerine,项目名称:zygomys,代码行数:46,代码来源:demo_go_structs_gen.go
示例11: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Key) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "u":
{
var tmp []byte
tmp, bts, err = msgp.ReadBytesBytes(bts, []byte(z.UUID))
z.UUID = ID(tmp)
}
if err != nil {
return
}
case "v":
z.Value, bts, err = msgp.ReadIntfBytes(bts)
if err != nil {
return
}
case "p":
z.Payload, bts, err = msgp.ReadBytesBytes(bts, z.Payload)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:jim3mar,项目名称:go-datastructures,代码行数:45,代码来源:node_gen.go
示例12: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *arrayContainer) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zcmr uint32
zcmr, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for zcmr > 0 {
zcmr--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "content":
var zajw uint32
zajw, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
return
}
if cap(z.content) >= int(zajw) {
z.content = (z.content)[:zajw]
} else {
z.content = make([]uint16, zajw)
}
for zxvk := range z.content {
z.content[zxvk], bts, err = msgp.ReadUint16Bytes(bts)
if err != nil {
return
}
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:43,代码来源:arraycontainer_gen.go
示例13: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Attribute) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var bzg uint32
bzg, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for bzg > 0 {
bzg--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "Id":
z.Id, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
case "Name":
z.Name, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "Value":
z.Value, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:darciopacifico,项目名称:enablecache,代码行数:41,代码来源:schema_gen.go
示例14: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Outgoing) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "time":
z.Time, bts, err = msgp.ReadUint32Bytes(bts)
if err != nil {
return
}
case "from":
z.From, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "message":
z.Message, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:sztanpet,项目名称:bimpc,代码行数:41,代码来源:main_gen.go
示例15: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *EventHeader) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "message_id":
z.Id, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "v":
z.Version, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
case "response_to":
z.ResponseTo, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:mengzhuo,项目名称:zerorpc-golang,代码行数:41,代码来源:protocal_gen.go
示例16: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Date) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "Year":
z.Year, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
case "Month":
z.Month, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
case "Day":
z.Day, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:glycerine,项目名称:tmframe,代码行数:41,代码来源:date_gen.go
示例17: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *containerSerz) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zbai uint32
zbai, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for zbai > 0 {
zbai--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "t":
{
var zcmr uint8
zcmr, bts, err = msgp.ReadUint8Bytes(bts)
z.t = contype(zcmr)
}
if err != nil {
return
}
case "r":
bts, err = z.r.UnmarshalMsg(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:40,代码来源:roaringarray_gen.go
示例18: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *ProbeEvent) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "Id":
z.Id, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "EventType":
z.EventType, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "OrgId":
z.OrgId, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
case "Severity":
z.Severity, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "Source":
z.Source, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "Timestamp":
z.Timestamp, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
case "Message":
z.Message, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "Tags":
var msz uint32
msz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
if z.Tags == nil && msz > 0 {
z.Tags = make(map[string]string, msz)
} else if len(z.Tags) > 0 {
for key, _ := range z.Tags {
delete(z.Tags, key)
}
}
for msz > 0 {
var xvk string
var bzg string
msz--
xvk, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
bzg, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
z.Tags[xvk] = bzg
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
开发者ID:graphite-ng,项目名称:carbon-relay-ng,代码行数:88,代码来源:event_gen.go
示例19: UnmarshalMsg
// UnmarshalMsg implements msgp.Unmarshaler
func (z *MetricDefinition) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var isz uint32
isz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for isz > 0 {
isz--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "Id":
z.Id, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "OrgId":
z.OrgId, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
case "Name":
z.Name, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "Metric":
z.Metric, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "Interval":
z.Interval, bts, err = msgp.ReadIntBytes(bts)
if err != nil {
return
}
case "Unit":
z.Unit, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "TargetType":
z.TargetType, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
case "Tags":
var xsz uint32
xsz, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
return
}
if cap(z.Tags) >= int(xsz) {
z.Tags = z.Tags[:xsz]
} else {
z.Tags = make([]string, xsz)
}
for hct := range z.Tags {
z.Tags[hct], bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
}
case "LastUpdate":
z.LastUpdate, bts, err = msgp.ReadInt64Bytes(bts)
if err != nil {
return
}
case "Nodes":
var msz uint32
msz, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
if z.Nodes == nil && msz > 0 {
z.Nodes = make(map[string]string, msz)
} else if len(z.Nodes) > 0 {
for key, _ := range z.Nodes {
delete(z.Nodes, key)
}
}
for msz > 0 {
var cua string
var xhx string
msz--
cua, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
xhx, bts, err = msgp.ReadStringBytes(bts)
if err != nil {
return
}
z.Nodes[cua] = xhx
}
//.........这里部分代码省略.........
开发者ID:aglagla,项目名称:raintank-metric,代码行数:101,代码来源:metric_gen.go
注:本文中的github.com/tinylib/msgp/msgp.ReadMapHeaderBytes函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论