當前位置: 首頁>>代碼示例>>Golang>>正文


Golang TProtocol.ReadString方法代碼示例

本文整理匯總了Golang中thrift.TProtocol.ReadString方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.ReadString方法的具體用法?Golang TProtocol.ReadString怎麽用?Golang TProtocol.ReadString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在thrift.TProtocol的用法示例。


在下文中一共展示了TProtocol.ReadString方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: readField3

func (p *FindAllArgs) readField3(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return fmt.Errorf("error reading map begin: %s")
	}
	p.Param = make(map[string]string, size)
	for i := 0; i < size; i++ {
		var _key6 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s")
		} else {
			_key6 = v
		}
		var _val7 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s")
		} else {
			_val7 = v
		}
		p.Param[_key6] = _val7
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s")
	}
	return nil
}
開發者ID:viney,項目名稱:gothrift,代碼行數:26,代碼來源:rpc_service.go

示例2: readField2

func (p *FindAllArgs) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 2: %s")
	} else {
		p.Password = v
	}
	return nil
}
開發者ID:viney,項目名稱:gothrift,代碼行數:8,代碼來源:rpc_service.go

示例3: ReadField2

func (p *Reservation) ReadField2(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v2, err3 := iprot.ReadString()
	if err3 != nil {
		return thrift.NewTProtocolExceptionReadField(2, "secret", p.ThriftName(), err3)
	}
	p.Secret = v2
	return err
}
開發者ID:paulcnichols,項目名稱:BigSelect,代碼行數:8,代碼來源:ttypes.go

示例4: ReadField1

func (p *Reservation) ReadField1(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v0, err1 := iprot.ReadString()
	if err1 != nil {
		return thrift.NewTProtocolExceptionReadField(1, "queue", p.ThriftName(), err1)
	}
	p.Queue = v0
	return err
}
開發者ID:paulcnichols,項目名稱:BigSelect,代碼行數:8,代碼來源:ttypes.go

示例5: readField0

func (p *SecondServiceSecondtestStringResult) readField0(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 0: ", err)
	} else {
		p.Success = &v
	}
	return nil
}
開發者ID:sktzwhj,項目名稱:thrift-0.9.3,代碼行數:8,代碼來源:secondservice.go

示例6: readField1

func (p *SecondServiceSecondtestStringArgs) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Thing = v
	}
	return nil
}
開發者ID:sktzwhj,項目名稱:thrift-0.9.3,代碼行數:8,代碼來源:secondservice.go

示例7: readField0

func (p *FindAllResult) readField0(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return fmt.Errorf("error reading list being: %s")
	}
	p.Success = make([]string, 0, size)
	for i := 0; i < size; i++ {
		var _elem8 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s")
		} else {
			_elem8 = v
		}
		p.Success = append(p.Success, _elem8)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s")
	}
	return nil
}
開發者ID:viney,項目名稱:gothrift,代碼行數:20,代碼來源:rpc_service.go


注:本文中的thrift.TProtocol.ReadString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。