当前位置: 首页>>代码示例>>Golang>>正文


Golang TProtocol.ReadListBegin方法代码示例

本文整理汇总了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
}
开发者ID:cnicolov,项目名称:kit,代码行数:19,代码来源:ttypes.go

示例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
}
开发者ID:hustxiaoc,项目名称:tchannel,代码行数:19,代码来源:tcollector.go

示例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
}
开发者ID:ZhuJingfa,项目名称:go-platform,代码行数:19,代码来源:ttypes.go

示例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
}
开发者ID:gosuper,项目名称:tchannel-go,代码行数:19,代码来源:ttypes.go

示例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
}
开发者ID:hustxiaoc,项目名称:tchannel,代码行数:19,代码来源:tcollector.go

示例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
}
开发者ID:taion809,项目名称:go-zipkin,代码行数:19,代码来源:ttypes.go

示例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
}
开发者ID:akaspin,项目名称:bar,代码行数:19,代码来源:ttypes.go

示例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
}
开发者ID:cnicolov,项目名称:kit,代码行数:19,代码来源:scribe.go

示例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
}
开发者ID:gosuper,项目名称:tchannel-go,代码行数:19,代码来源:tcollector.go

示例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
}
开发者ID:gosuper,项目名称:tchannel-go,代码行数:19,代码来源:tcollector.go

示例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
}
开发者ID:cnicolov,项目名称:kit,代码行数:21,代码来源:zipkincollector.go

示例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
}
开发者ID:akaspin,项目名称:bar,代码行数:21,代码来源:ttypes.go


注:本文中的github.com/apache/thrift/lib/go/thrift.TProtocol.ReadListBegin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。