本文整理汇总了Golang中github.com/apesternikov/thrift4go/lib/go/src/thrift.TProtocol.WriteStructEnd方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.WriteStructEnd方法的具体用法?Golang TProtocol.WriteStructEnd怎么用?Golang TProtocol.WriteStructEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/apesternikov/thrift4go/lib/go/src/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteStructEnd方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Write
func (p *Work) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
err = oprot.WriteStructBegin("Work")
if err != nil {
return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
}
err = p.writeField1(oprot)
if err != nil {
return err
}
err = p.writeField2(oprot)
if err != nil {
return err
}
err = p.writeField3(oprot)
if err != nil {
return err
}
err = p.writeField4(oprot)
if err != nil {
return err
}
err = oprot.WriteFieldStop()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(-1, "STOP", p.ThriftName(), err)
}
err = oprot.WriteStructEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
}
return err
}
示例2: Write
func (p *CalculateResult) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
err = oprot.WriteStructBegin("calculate_result")
if err != nil {
return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
}
switch {
case p.Ouch != nil:
if err = p.writeField1(oprot); err != nil {
return err
}
default:
if err = p.writeField0(oprot); err != nil {
return err
}
}
err = oprot.WriteFieldStop()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(-1, "STOP", p.ThriftName(), err)
}
err = oprot.WriteStructEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
}
return err
}
示例3: Write
func (p *MyMethodResult) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
err = oprot.WriteStructBegin("myMethod_result")
if err != nil {
return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
}
err = oprot.WriteFieldStop()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(-1, "STOP", p.ThriftName(), err)
}
err = oprot.WriteStructEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
}
return err
}
示例4: Write
func (p *MethodThatThrowsAnExceptionResult) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
err = oprot.WriteStructBegin("methodThatThrowsAnException_result")
if err != nil {
return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
}
switch {
case p.Xwamap != nil:
if err = p.writeField1(oprot); err != nil {
return err
}
}
err = oprot.WriteFieldStop()
if err != nil {
return thrift.NewTProtocolExceptionWriteField(-1, "STOP", p.ThriftName(), err)
}
err = oprot.WriteStructEnd()
if err != nil {
return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
}
return err
}