本文整理匯總了Golang中github.com/DeviantArt/centrifugo-scriber/Godeps/_workspace/src/github.com/apache/thrift/lib/go/thrift.TProtocol.WriteFieldEnd方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.WriteFieldEnd方法的具體用法?Golang TProtocol.WriteFieldEnd怎麽用?Golang TProtocol.WriteFieldEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/DeviantArt/centrifugo-scriber/Godeps/_workspace/src/github.com/apache/thrift/lib/go/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteFieldEnd方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: writeField2
func (p *LogEntry) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("message", thrift.STRING, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:message: %s", p, err)
}
if err := oprot.WriteString(string(p.Message)); err != nil {
return fmt.Errorf("%T.message (2) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:message: %s", p, err)
}
return err
}
示例2: writeField1
func (p *LogEntry) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("category", thrift.STRING, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:category: %s", p, err)
}
if err := oprot.WriteString(string(p.Category)); err != nil {
return fmt.Errorf("%T.category (1) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 1:category: %s", p, err)
}
return err
}
示例3: writeField0
func (p *LogResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err := oprot.WriteFieldBegin("success", thrift.I32, 0); err != nil {
return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
}
if err := oprot.WriteI32(int32(*p.Success)); err != nil {
return fmt.Errorf("%T.success (0) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 0:success: %s", p, err)
}
}
return err
}
示例4: writeField1
func (p *LogArgs) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("messages", thrift.LIST, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:messages: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Messages)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.Messages {
if err := v.Write(oprot); err != nil {
return fmt.Errorf("%T error writing struct: %s", v, err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return fmt.Errorf("error writing list end: %s", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 1:messages: %s", p, err)
}
return err
}