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


Golang TProtocol.WriteI32方法代码示例

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


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

示例1: writeField3

func (p *Manylists) writeField3(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.I32list != nil {
		err = oprot.WriteFieldBegin("i32list", thrift.LIST, 3)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(3, "i32list", p.ThriftName(), err)
		}
		err = oprot.WriteListBegin(thrift.I32, len(p.I32list))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		for _, Iter79 := range p.I32list {
			err = oprot.WriteI32(int32(Iter79))
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(0, "Iter79", "", err)
			}
		}
		err = oprot.WriteListEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(3, "i32list", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:27,代码来源:ttypes.go

示例2: writeField1

func (p *InvalidOperation) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("what", thrift.I32, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "what", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.What))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "what", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "what", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:ttypes.go

示例3: writeField2

func (p *Work) writeField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("num2", thrift.I32, 2)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "num2", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.Num2))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "num2", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "num2", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:ttypes.go

示例4: writeField1

func (p *Ping) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("timestamp", thrift.I32, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "timestamp", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.Timestamp))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "timestamp", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "timestamp", p.ThriftName(), err)
	}
	return err
}
开发者ID:Digaku,项目名称:ansvia-lessons,代码行数:15,代码来源:ttypes.go

示例5: writeField2

func (p *MyMethodArgs) writeField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("third", thrift.I32, 2)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "third", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.Third))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "third", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "third", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:ReverseOrderService.go

示例6: writeField1

func (p *AddArgs) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("num1", thrift.I32, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "num1", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.Num1))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "num1", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "num1", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:Calculator.go

示例7: writeField0

func (p *CalculateResult) writeField0(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("success", thrift.I32, 0)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(0, "success", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.Success))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(0, "success", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(0, "success", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:Calculator.go

示例8: writeField7

func (p *Manylists) writeField7(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.IsSetOptionalint() {
		err = oprot.WriteFieldBegin("optionalint", thrift.I32, 7)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(7, "optionalint", p.ThriftName(), err)
		}
		err = oprot.WriteI32(int32(p.Optionalint))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(7, "optionalint", p.ThriftName(), err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(7, "optionalint", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:17,代码来源:ttypes.go

示例9: writeField6

func (p *Manylists) writeField6(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Listoflist != nil {
		err = oprot.WriteFieldBegin("listoflist", thrift.LIST, 6)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(6, "listoflist", p.ThriftName(), err)
		}
		err = oprot.WriteListBegin(thrift.LIST, len(p.Listoflist))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		for _, Iter82 := range p.Listoflist {
			err = oprot.WriteListBegin(thrift.I32, len(Iter82))
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
			}
			for _, Iter83 := range Iter82 {
				err = oprot.WriteI32(int32(Iter83))
				if err != nil {
					return thrift.NewTProtocolExceptionWriteField(0, "Iter83", "", err)
				}
			}
			err = oprot.WriteListEnd()
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
			}
		}
		err = oprot.WriteListEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(6, "listoflist", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:37,代码来源:ttypes.go


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