本文整理汇总了Golang中github.com/apache/thrift/lib/go/thrift.TProtocol.ReadBinary方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.ReadBinary方法的具体用法?Golang TProtocol.ReadBinary怎么用?Golang TProtocol.ReadBinary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/apache/thrift/lib/go/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.ReadBinary方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ReadField3
func (p *Spec) ReadField3(iprot thrift.TProtocol) error {
_, _, size, err := iprot.ReadMapBegin()
if err != nil {
return thrift.PrependError("error reading map begin: ", err)
}
tMap := make(map[string]ID, size)
p.Blobs = tMap
for i := 0; i < size; i++ {
var _key2 string
if v, err := iprot.ReadString(); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_key2 = v
}
var _val3 ID
if v, err := iprot.ReadBinary(); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
temp := ID(v)
_val3 = temp
}
p.Blobs[_key2] = _val3
}
if err := iprot.ReadMapEnd(); err != nil {
return thrift.PrependError("error reading map end: ", err)
}
return nil
}
示例2: readField2
func (p *BinaryAnnotation) readField2(iprot thrift.TProtocol) error {
if v, err := iprot.ReadBinary(); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.Value = v
}
return nil
}
示例3: ReadField2
func (p *BinaryAnnotation) ReadField2(iprot thrift.TProtocol) error {
if v, err := iprot.ReadBinary(); err != nil {
return fmt.Errorf("error reading field 2: %s", err)
} else {
p.Value = v
}
return nil
}
示例4: readField5
func (p *Span) readField5(iprot thrift.TProtocol) error {
if v, err := iprot.ReadBinary(); err != nil {
return thrift.PrependError("error reading field 5: ", err)
} else {
p.ParentId = v
}
return nil
}
示例5: ReadField5
func (p *Span) ReadField5(iprot thrift.TProtocol) error {
if v, err := iprot.ReadBinary(); err != nil {
return fmt.Errorf("error reading field 5: %s", err)
} else {
p.ParentId = v
}
return nil
}
示例6: ReadField1
func (p *Spec) ReadField1(iprot thrift.TProtocol) error {
if v, err := iprot.ReadBinary(); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
temp := ID(v)
p.Id = temp
}
return nil
}