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


Golang TProtocol.ReadI32方法代碼示例

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


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

示例1: readField3

func (p *Manymaps) readField3(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_ktype31, _vtype32, _size30, err := iprot.ReadMapBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadField(-1, "p.I32map", "", err)
	}
	_, _ = _ktype31, _vtype32
	p.I32map = make(map[int32]string, _size30)
	for i := 0; i < _size30; i++ {
		v37, err38 := iprot.ReadI32()
		if err38 != nil {
			return thrift.NewTProtocolExceptionReadField(0, "_key35", "", err38)
		}
		_key35 := v37
		v39, err40 := iprot.ReadString()
		if err40 != nil {
			return thrift.NewTProtocolExceptionReadField(0, "_val36", "", err40)
		}
		_val36 := v39
		p.I32map[_key35] = _val36
	}
	err = iprot.ReadMapEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
	}
	return err
}
開發者ID:mohanarpit,項目名稱:goh,代碼行數:26,代碼來源:ttypes.go

示例2: readField6

func (p *Manylists) readField6(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_etype62, _size59, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadField(-1, "p.Listoflist", "", err)
	}
	_ = _etype62
	p.Listoflist = make([][]int32, _size59, _size59)
	for i := 0; i < _size59; i++ {
		_etype70, _size67, err := iprot.ReadListBegin()
		if err != nil {
			return thrift.NewTProtocolExceptionReadField(-1, "_elem64", "", err)
		}
		_ = _etype70
		_elem64 := make([]int32, _size67, _size67)
		for i := 0; i < _size67; i++ {
			v73, err74 := iprot.ReadI32()
			if err74 != nil {
				return thrift.NewTProtocolExceptionReadField(0, "_elem72", "", err74)
			}
			_elem72 := v73
			_elem64[i] = _elem72
		}
		err = iprot.ReadListEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionReadField(-1, "", "list", err)
		}
		p.Listoflist[i] = _elem64
	}
	err = iprot.ReadListEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionReadField(-1, "", "list", err)
	}
	return err
}
開發者ID:mohanarpit,項目名稱:goh,代碼行數:34,代碼來源:ttypes.go

示例3: readField1

func (p *Ping) readField1(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v0, err1 := iprot.ReadI32()
	if err1 != nil {
		return thrift.NewTProtocolExceptionReadField(1, "timestamp", p.ThriftName(), err1)
	}
	p.Timestamp = v0
	return err
}
開發者ID:Digaku,項目名稱:ansvia-lessons,代碼行數:8,代碼來源:ttypes.go

示例4: readField2

func (p *MyMethodArgs) readField2(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v1123, err1124 := iprot.ReadI32()
	if err1124 != nil {
		return thrift.NewTProtocolExceptionReadField(2, "third", p.ThriftName(), err1124)
	}
	p.Third = v1123
	return err
}
開發者ID:mohanarpit,項目名稱:goh,代碼行數:8,代碼來源:ReverseOrderService.go

示例5: readField1

func (p *Intstruct) readField1(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v0, err1 := iprot.ReadI32()
	if err1 != nil {
		return thrift.NewTProtocolExceptionReadField(1, "ifield", p.ThriftName(), err1)
	}
	p.Ifield = v0
	return err
}
開發者ID:mohanarpit,項目名稱:goh,代碼行數:8,代碼來源:ttypes.go

示例6: readField7

func (p *Manylists) readField7(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v75, err76 := iprot.ReadI32()
	if err76 != nil {
		return thrift.NewTProtocolExceptionReadField(7, "optionalint", p.ThriftName(), err76)
	}
	p.Optionalint = v75
	return err
}
開發者ID:mohanarpit,項目名稱:goh,代碼行數:8,代碼來源:ttypes.go

示例7: readField2

func (p *MulArgs) readField2(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v21, err22 := iprot.ReadI32()
	if err22 != nil {
		return thrift.NewTProtocolExceptionReadField(2, "num2", p.ThriftName(), err22)
	}
	p.Num2 = v21
	return err
}
開發者ID:Digaku,項目名稱:ansvia-lessons,代碼行數:8,代碼來源:TrancamServer.go

示例8: readField0

func (p *AddResult) readField0(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v46, err47 := iprot.ReadI32()
	if err47 != nil {
		return thrift.NewTProtocolExceptionReadField(0, "success", p.ThriftName(), err47)
	}
	p.Success = v46
	return err
}
開發者ID:mohanarpit,項目名稱:goh,代碼行數:8,代碼來源:Calculator.go

示例9: readField2

func (p *AddArgs) readField2(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v44, err45 := iprot.ReadI32()
	if err45 != nil {
		return thrift.NewTProtocolExceptionReadField(2, "num2", p.ThriftName(), err45)
	}
	p.Num2 = v44
	return err
}
開發者ID:mohanarpit,項目名稱:goh,代碼行數:8,代碼來源:Calculator.go

示例10: readField1

func (p *AddArgs) readField1(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v42, err43 := iprot.ReadI32()
	if err43 != nil {
		return thrift.NewTProtocolExceptionReadField(1, "num1", p.ThriftName(), err43)
	}
	p.Num1 = v42
	return err
}
開發者ID:mohanarpit,項目名稱:goh,代碼行數:8,代碼來源:Calculator.go

示例11: readField0

func (p *MulResult) readField0(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v23, err24 := iprot.ReadI32()
	if err24 != nil {
		return thrift.NewTProtocolExceptionReadField(0, "success", p.ThriftName(), err24)
	}
	p.Success = v23
	return err
}
開發者ID:Digaku,項目名稱:ansvia-lessons,代碼行數:8,代碼來源:TrancamServer.go

示例12: readField2

func (p *Work) readField2(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v2, err3 := iprot.ReadI32()
	if err3 != nil {
		return thrift.NewTProtocolExceptionReadField(2, "num2", p.ThriftName(), err3)
	}
	p.Num2 = v2
	return err
}
開發者ID:mohanarpit,項目名稱:goh,代碼行數:8,代碼來源:ttypes.go

示例13: readField1

func (p *MulArgs) readField1(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	v19, err20 := iprot.ReadI32()
	if err20 != nil {
		return thrift.NewTProtocolExceptionReadField(1, "num1", p.ThriftName(), err20)
	}
	p.Num1 = v19
	return err
}
開發者ID:Digaku,項目名稱:ansvia-lessons,代碼行數:8,代碼來源:TrancamServer.go


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