當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。