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


Golang TProtocol.ReadListBegin方法代码示例

本文整理汇总了Golang中github.com/bcgraham/tsumtsum/external/thrift.TProtocol.ReadListBegin方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.ReadListBegin方法的具体用法?Golang TProtocol.ReadListBegin怎么用?Golang TProtocol.ReadListBegin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/bcgraham/tsumtsum/external/thrift.TProtocol的用法示例。


在下文中一共展示了TProtocol.ReadListBegin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: ReadField0

func (p *MultiGetLastReadMessageIdsResult) ReadField0(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return fmt.Errorf("error reading list begin: %s", err)
	}
	tSlice := make([]*LastReadMessageIds, 0, size)
	p.Success = tSlice
	for i := 0; i < size; i++ {
		_elem745 := &LastReadMessageIds{}
		if err := _elem745.Read(iprot); err != nil {
			return fmt.Errorf("%T error reading struct: %s", _elem745, err)
		}
		p.Success = append(p.Success, _elem745)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s", err)
	}
	return nil
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:19,代码来源:messageservice.go

示例2: ReadField0

func (p *GetContactsResult) ReadField0(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return fmt.Errorf("error reading list begin: %s", err)
	}
	tSlice := make([]*Contact, 0, size)
	p.Success = tSlice
	for i := 0; i < size; i++ {
		_elem1358 := &Contact{}
		if err := _elem1358.Read(iprot); err != nil {
			return fmt.Errorf("%T error reading struct: %s", _elem1358, err)
		}
		p.Success = append(p.Success, _elem1358)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s", err)
	}
	return nil
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:19,代码来源:getcontacts.go

示例3: ReadField0

func (p *GetAllContactIdsResult) ReadField0(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.Success = tSlice
	for i := 0; i < size; i++ {
		var _elem1351 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_elem1351 = v
		}
		p.Success = append(p.Success, _elem1351)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s", err)
	}
	return nil
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:21,代码来源:getallcontactids.go

示例4: ReadField2

func (p *MultiGetLastReadMessageIdsArgs) 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.ChatIds = tSlice
	for i := 0; i < size; i++ {
		var _elem744 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_elem744 = v
		}
		p.ChatIds = append(p.ChatIds, _elem744)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s", err)
	}
	return nil
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:21,代码来源:messageservice.go


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