本文整理汇总了Golang中github.com/tinylib/msgp/msgp.Reader.ReadInt64方法的典型用法代码示例。如果您正苦于以下问题:Golang Reader.ReadInt64方法的具体用法?Golang Reader.ReadInt64怎么用?Golang Reader.ReadInt64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/tinylib/msgp/msgp.Reader
的用法示例。
在下文中一共展示了Reader.ReadInt64方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *Message) DecodeMsg(dc *msgp.Reader) (err error) {
var ssz uint32
ssz, err = dc.ReadArrayHeader()
if err != nil {
return
}
if ssz != 4 {
err = msgp.ArrayError{Wanted: 4, Got: ssz}
return
}
z.Tag, err = dc.ReadString()
if err != nil {
return
}
z.Time, err = dc.ReadInt64()
if err != nil {
return
}
z.Record, err = dc.ReadIntf()
if err != nil {
return
}
z.Option, err = dc.ReadIntf()
if err != nil {
return
}
return
}
示例2: 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
}
示例3: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *runIterator32) 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 "rc":
if dc.IsNil() {
err = dc.ReadNil()
if err != nil {
return
}
z.rc = nil
} else {
if z.rc == nil {
z.rc = new(runContainer32)
}
err = z.rc.DecodeMsg(dc)
if err != nil {
return
}
}
case "curIndex":
z.curIndex, err = dc.ReadInt64()
if err != nil {
return
}
case "curPosInIndex":
z.curPosInIndex, err = dc.ReadUint32()
if err != nil {
return
}
case "curSeq":
z.curSeq, err = dc.ReadInt64()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例4: 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
}
示例5: 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
}
示例6: 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
}
示例7: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *MetricDefinition) 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.ReadString()
if err != nil {
return
}
case "OrgId":
z.OrgId, err = dc.ReadInt()
if err != nil {
return
}
case "Name":
z.Name, err = dc.ReadString()
if err != nil {
return
}
case "Metric":
z.Metric, err = dc.ReadString()
if err != nil {
return
}
case "Interval":
z.Interval, err = dc.ReadInt()
if err != nil {
return
}
case "Unit":
z.Unit, err = dc.ReadString()
if err != nil {
return
}
case "TargetType":
z.TargetType, err = dc.ReadString()
if err != nil {
return
}
case "Tags":
var xsz uint32
xsz, err = dc.ReadArrayHeader()
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], err = dc.ReadString()
if err != nil {
return
}
}
case "LastUpdate":
z.LastUpdate, err = dc.ReadInt64()
if err != nil {
return
}
case "Nodes":
var msz uint32
msz, err = dc.ReadMapHeader()
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 {
msz--
var cua string
var xhx string
cua, err = dc.ReadString()
if err != nil {
return
}
xhx, err = dc.ReadString()
if err != nil {
return
}
z.Nodes[cua] = xhx
}
//.........这里部分代码省略.........
示例8: DecodeMsg
// DecodeMsg implements msgp.Decodable
func (z *ProbeEvent) 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.ReadString()
if err != nil {
return
}
case "EventType":
z.EventType, err = dc.ReadString()
if err != nil {
return
}
case "OrgId":
z.OrgId, err = dc.ReadInt64()
if err != nil {
return
}
case "Severity":
z.Severity, err = dc.ReadString()
if err != nil {
return
}
case "Source":
z.Source, err = dc.ReadString()
if err != nil {
return
}
case "Timestamp":
z.Timestamp, err = dc.ReadInt64()
if err != nil {
return
}
case "Message":
z.Message, err = dc.ReadString()
if err != nil {
return
}
case "Tags":
var msz uint32
msz, err = dc.ReadMapHeader()
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 {
msz--
var xvk string
var bzg string
xvk, err = dc.ReadString()
if err != nil {
return
}
bzg, err = dc.ReadString()
if err != nil {
return
}
z.Tags[xvk] = bzg
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
示例9: 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
}