本文整理汇总了Golang中github.com/apache/thrift/lib/go/thrift.TProtocol.ReadListBegin方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.ReadListBegin方法的具体用法?Golang TProtocol.ReadListBegin怎么用?Golang TProtocol.ReadListBegin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/apache/thrift/lib/go/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.ReadListBegin方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ReadField3
func (p *Dependencies) ReadField3(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return fmt.Errorf("error reading list begin: %s", err)
}
tSlice := make([]*DependencyLink, 0, size)
p.Links = tSlice
for i := 0; i < size; i++ {
_elem0 := &DependencyLink{}
if err := _elem0.Read(iprot); err != nil {
return fmt.Errorf("%T error reading struct: %s", _elem0, err)
}
p.Links = append(p.Links, _elem0)
}
if err := iprot.ReadListEnd(); err != nil {
return fmt.Errorf("error reading list end: %s", err)
}
return nil
}
示例2: ReadField0
func (p *MultiSubmitResult) ReadField0(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return fmt.Errorf("error reading list begin: %s", err)
}
tSlice := make([]*Response, 0, size)
p.Success = tSlice
for i := 0; i < size; i++ {
_elem9 := &Response{}
if err := _elem9.Read(iprot); err != nil {
return fmt.Errorf("%T error reading struct: %s", _elem9, err)
}
p.Success = append(p.Success, _elem9)
}
if err := iprot.ReadListEnd(); err != nil {
return fmt.Errorf("error reading list end: %s", err)
}
return nil
}
示例3: readField8
func (p *Span) readField8(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]*BinaryAnnotation, 0, size)
p.BinaryAnnotations = tSlice
for i := 0; i < size; i++ {
_elem1 := &BinaryAnnotation{}
if err := _elem1.Read(iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err)
}
p.BinaryAnnotations = append(p.BinaryAnnotations, _elem1)
}
if err := iprot.ReadListEnd(); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
示例4: readField1
func (p *DiscoveryResult_) readField1(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]*ServicePeer, 0, size)
p.Peers = tSlice
for i := 0; i < size; i++ {
_elem0 := &ServicePeer{}
if err := _elem0.Read(iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err)
}
p.Peers = append(p.Peers, _elem0)
}
if err := iprot.ReadListEnd(); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
示例5: ReadField1
func (p *MultiSubmitArgs) ReadField1(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return fmt.Errorf("error reading list begin: %s", err)
}
tSlice := make([]*Span, 0, size)
p.Spans = tSlice
for i := 0; i < size; i++ {
_elem8 := &Span{}
if err := _elem8.Read(iprot); err != nil {
return fmt.Errorf("%T error reading struct: %s", _elem8, err)
}
p.Spans = append(p.Spans, _elem8)
}
if err := iprot.ReadListEnd(); err != nil {
return fmt.Errorf("error reading list end: %s", err)
}
return nil
}
示例6: ReadField6
func (p *Span) ReadField6(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return fmt.Errorf("error reading list begin: %s", err)
}
tSlice := make([]*Annotation, 0, size)
p.Annotations = tSlice
for i := 0; i < size; i++ {
_elem0 := &Annotation{}
if err := _elem0.Read(iprot); err != nil {
return fmt.Errorf("%T error reading struct: %s", _elem0, err)
}
p.Annotations = append(p.Annotations, _elem0)
}
if err := iprot.ReadListEnd(); err != nil {
return fmt.Errorf("error reading list end: %s", err)
}
return nil
}
示例7: ReadField2
func (p *Manifest) ReadField2(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]*Chunk, 0, size)
p.Chunks = tSlice
for i := 0; i < size; i++ {
_elem1 := &Chunk{}
if err := _elem1.Read(iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err)
}
p.Chunks = append(p.Chunks, _elem1)
}
if err := iprot.ReadListEnd(); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
示例8: ReadField1
func (p *LogArgs) ReadField1(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return fmt.Errorf("error reading list begin: %s", err)
}
tSlice := make([]*LogEntry, 0, size)
p.Messages = tSlice
for i := 0; i < size; i++ {
_elem4 := &LogEntry{}
if err := _elem4.Read(iprot); err != nil {
return fmt.Errorf("%T error reading struct: %s", _elem4, err)
}
p.Messages = append(p.Messages, _elem4)
}
if err := iprot.ReadListEnd(); err != nil {
return fmt.Errorf("error reading list end: %s", err)
}
return nil
}
示例9: readField0
func (p *TCollectorSubmitBatchResult) readField0(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]*Response, 0, size)
p.Success = tSlice
for i := 0; i < size; i++ {
_elem11 := &Response{}
if err := _elem11.Read(iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err)
}
p.Success = append(p.Success, _elem11)
}
if err := iprot.ReadListEnd(); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
示例10: readField1
func (p *TCollectorSubmitBatchArgs) readField1(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]*Span, 0, size)
p.Spans = tSlice
for i := 0; i < size; i++ {
_elem10 := &Span{}
if err := _elem10.Read(iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err)
}
p.Spans = append(p.Spans, _elem10)
}
if err := iprot.ReadListEnd(); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
示例11: ReadField2
func (p *StoreTopKeyValueAnnotationsArgs) ReadField2(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return fmt.Errorf("error reading list begin: %s", err)
}
tSlice := make([]string, 0, size)
p.Annotations = tSlice
for i := 0; i < size; i++ {
var _elem8 string
if v, err := iprot.ReadString(); err != nil {
return fmt.Errorf("error reading field 0: %s", err)
} else {
_elem8 = v
}
p.Annotations = append(p.Annotations, _elem8)
}
if err := iprot.ReadListEnd(); err != nil {
return fmt.Errorf("error reading list end: %s", err)
}
return nil
}
示例12: ReadField4
func (p *Spec) ReadField4(iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin()
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]string, 0, size)
p.Removes = tSlice
for i := 0; i < size; i++ {
var _elem4 string
if v, err := iprot.ReadString(); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem4 = v
}
p.Removes = append(p.Removes, _elem4)
}
if err := iprot.ReadListEnd(); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}