本文整理汇总了Golang中github.com/bcgraham/tsumtsum/external/thrift.TProtocol.WriteListBegin方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.WriteListBegin方法的具体用法?Golang TProtocol.WriteListBegin怎么用?Golang TProtocol.WriteListBegin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/bcgraham/tsumtsum/external/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteListBegin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: writeField2
func (p *MultiGetLastReadMessageIdsArgs) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("chatIds", thrift.LIST, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:chatIds: %s", p, err)
}
if err := oprot.WriteListBegin(thrift.STRING, len(p.ChatIds)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.ChatIds {
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:chatIds: %s", p, err)
}
return err
}
示例2: writeField0
func (p *GetAllContactIdsResult) 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.STRING, len(p.Success)); err != nil {
return fmt.Errorf("error writing list begin: %s", err)
}
for _, v := range p.Success {
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 0:success: %s", p, err)
}
}
return err
}
示例3: writeField0
func (p *MultiGetLastReadMessageIdsResult) 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
}