本文整理匯總了Golang中thrift.TProtocol.WriteI32方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.WriteI32方法的具體用法?Golang TProtocol.WriteI32怎麽用?Golang TProtocol.WriteI32使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteI32方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: WriteField9
func (p *ContainerOfEnums) WriteField9(oprot thrift.TProtocol) (err thrift.TProtocolException) {
if p.IsSetDefaultNineth() {
err = oprot.WriteFieldBegin("default_nineth", thrift.I32, 9)
if err != nil {
return thrift.NewTProtocolExceptionWriteField(9, "default_nineth", p.ThriftName(), err)
}
err = oprot.WriteI32(int32(p.DefaultNineth))
if err != nil {
return thrift.NewTProtocolExceptionWriteField(9, "default_nineth", p.ThriftName(), err)
}
err = oprot.WriteFieldEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(9, "default_nineth", p.ThriftName(), err)
}
}
return err
}
示例2: WriteField6
func (p *ContainerOfEnums) WriteField6(oprot thrift.TProtocol) (err thrift.TProtocolException) {
if p.IsSetOptionalSixth() {
err = oprot.WriteFieldBegin("optional_sixth", thrift.I32, 6)
if err != nil {
return thrift.NewTProtocolExceptionWriteField(6, "optional_sixth", p.ThriftName(), err)
}
err = oprot.WriteI32(int32(p.OptionalSixth))
if err != nil {
return thrift.NewTProtocolExceptionWriteField(6, "optional_sixth", p.ThriftName(), err)
}
err = oprot.WriteFieldEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(6, "optional_sixth", p.ThriftName(), err)
}
}
return err
}
示例3: WriteField2
func (p *ContainerOfEnums) WriteField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
if p.IsSetSecond() {
err = oprot.WriteFieldBegin("second", thrift.I32, 2)
if err != nil {
return thrift.NewTProtocolExceptionWriteField(2, "second", p.ThriftName(), err)
}
err = oprot.WriteI32(int32(p.Second))
if err != nil {
return thrift.NewTProtocolExceptionWriteField(2, "second", p.ThriftName(), err)
}
err = oprot.WriteFieldEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(2, "second", p.ThriftName(), err)
}
}
return err
}
示例4: WriteField3
func (p *ContainerOfEnums) WriteField3(oprot thrift.TProtocol) (err thrift.TProtocolException) {
if p.IsSetThird() {
err = oprot.WriteFieldBegin("third", thrift.I32, 3)
if err != nil {
return thrift.NewTProtocolExceptionWriteField(3, "third", p.ThriftName(), err)
}
err = oprot.WriteI32(int32(p.Third))
if err != nil {
return thrift.NewTProtocolExceptionWriteField(3, "third", p.ThriftName(), err)
}
err = oprot.WriteFieldEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(3, "third", p.ThriftName(), err)
}
}
return err
}
示例5: WriteField1
func (p *ContainerOfEnums) WriteField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
if p.IsSetFirst() {
err = oprot.WriteFieldBegin("first", thrift.I32, 1)
if err != nil {
return thrift.NewTProtocolExceptionWriteField(1, "first", p.ThriftName(), err)
}
err = oprot.WriteI32(int32(p.First))
if err != nil {
return thrift.NewTProtocolExceptionWriteField(1, "first", p.ThriftName(), err)
}
err = oprot.WriteFieldEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(1, "first", p.ThriftName(), err)
}
}
return err
}