本文整理匯總了Golang中github.com/apache/thrift/lib/go/thrift.TProtocol.WriteListEnd方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.WriteListEnd方法的具體用法?Golang TProtocol.WriteListEnd怎麽用?Golang TProtocol.WriteListEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/apache/thrift/lib/go/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteListEnd方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: writeField3
func (p *Dependencies) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("links", thrift.LIST, 3); err != nil {
return fmt.Errorf("%T write field begin error 3:links: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Links)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.Links {
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 3:links: %s", p, err)
}
return err
}
示例2: writeField2
func (p *StoreTopKeyValueAnnotationsArgs) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("annotations", thrift.LIST, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:annotations: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRING, len(p.Annotations)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.Annotations {
if err := oprot.WriteString(string(v)); err != nil {
return fmt.Errorf("%T. (0) field write error: %s", p, 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 2:annotations: %s", p, err)
}
return err
}
示例3: writeField8
func (p *Span) writeField8(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("binary_annotations", thrift.LIST, 8); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:binary_annotations: ", p), err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.BinaryAnnotations)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.BinaryAnnotations {
if err := v.Write(oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binary_annotations: ", p), err)
}
return err
}
示例4: writeField1
func (p *MultiSubmitArgs) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("spans", thrift.LIST, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:spans: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Spans)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.Spans {
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:spans: %s", p, err)
}
return err
}
示例5: writeField6
func (p *Span) writeField6(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("annotations", thrift.LIST, 6); err != nil {
return fmt.Errorf("%T write field begin error 6:annotations: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Annotations)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.Annotations {
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 6:annotations: %s", p, err)
}
return err
}
示例6: writeField1
func (p *TCollectorMultiSubmitArgs) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("spans", thrift.LIST, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spans: ", p), err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Spans)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.Spans {
if err := v.Write(oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:spans: ", p), err)
}
return err
}
示例7: writeField1
func (p *DiscoveryResult_) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("peers", thrift.LIST, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:peers: ", p), err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Peers)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.Peers {
if err := v.Write(oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:peers: ", p), err)
}
return err
}
示例8: writeField4
func (p *Spec) writeField4(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("removes", thrift.LIST, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:removes: ", p), err)
}
if err := oprot.WriteListBegin(thrift.STRING, len(p.Removes)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.Removes {
if err := oprot.WriteString(string(v)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:removes: ", p), err)
}
return err
}
示例9: writeField2
func (p *Manifest) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("chunks", thrift.LIST, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:chunks: ", p), err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Chunks)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.Chunks {
if err := v.Write(oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:chunks: ", p), err)
}
return err
}
示例10: writeField0
func (p *MultiSubmitResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.Success {
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 0:success: %s", p, err)
}
}
return err
}
示例11: writeField0
func (p *TCollectorSubmitBatchResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
}
if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.Success {
if err := v.Write(oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
}
}
if err := oprot.WriteListEnd(); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
}
}
return err
}