本文整理汇总了Golang中git/apache/org/thrift/git/lib/go/thrift.TProtocol.WriteI32方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.WriteI32方法的具体用法?Golang TProtocol.WriteI32怎么用?Golang TProtocol.WriteI32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git/apache/org/thrift/git/lib/go/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteI32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: writeField9
func (p *Types) writeField9(oprot thrift.TProtocol) (err error) {
if p.IsSetMapValue() {
if err := oprot.WriteFieldBegin("map_value", thrift.MAP, 9); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:map_value: ", p), err)
}
if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.MapValue)); err != nil {
return thrift.PrependError("error writing map begin: ", err)
}
for k, v := range p.MapValue {
if err := oprot.WriteString(string(k)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
}
if err := oprot.WriteI32(int32(v)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
}
}
if err := oprot.WriteMapEnd(); err != nil {
return thrift.PrependError("error writing map end: ", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 9:map_value: ", p), err)
}
}
return err
}
示例2: writeField1
func (p *TestCase1Args) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("num1", thrift.I32, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:num1: %s", p, err)
}
if err := oprot.WriteI32(int32(p.Num1)); err != nil {
return fmt.Errorf("%T.num1 (1) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 1:num1: %s", p, err)
}
return err
}
示例3: writeField3
func (p *UpdateStatusArgs) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("updateType", thrift.I32, 3); err != nil {
return fmt.Errorf("%T write field begin error 3:updateType: %s", p, err)
}
if err := oprot.WriteI32(int32(p.UpdateType)); err != nil {
return fmt.Errorf("%T.updateType (3) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 3:updateType: %s", p, err)
}
return err
}
示例4: writeField1
func (p *RpcException) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err)
}
if err := oprot.WriteI32(int32(p.Code)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err)
}
return err
}
示例5: writeField3
func (p *Work) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("op", thrift.I32, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:op: ", p), err)
}
if err := oprot.WriteI32(int32(p.Op)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.op (3) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:op: ", p), err)
}
return err
}
示例6: writeField6
func (p *GetPrivateMessageListArgs) writeField6(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("rowCount", thrift.I32, 6); err != nil {
return fmt.Errorf("%T write field begin error 6:rowCount: %s", p, err)
}
if err := oprot.WriteI32(int32(p.RowCount)); err != nil {
return fmt.Errorf("%T.rowCount (6) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 6:rowCount: %s", p, err)
}
return err
}
示例7: writeField2
func (p *VersaoThrift) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("minor", thrift.I32, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:minor: %s", p, err)
}
if err := oprot.WriteI32(int32(p.Minor)); err != nil {
return fmt.Errorf("%T.minor (2) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:minor: %s", p, err)
}
return err
}
示例8: writeField3
func (p *QueryResult) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("count", thrift.I32, 3); err != nil {
return fmt.Errorf("%T write field begin error 3:count: %s", p, err)
}
if err := oprot.WriteI32(int32(p.Count)); err != nil {
return fmt.Errorf("%T.count (3) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 3:count: %s", p, err)
}
return err
}
示例9: writeField2
func (p *AddArgs) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("num2", thrift.I32, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:num2: %s", p, err)
}
if err := oprot.WriteI32(int32(p.Num2)); err != nil {
return fmt.Errorf("%T.num2 (2) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:num2: %s", p, err)
}
return err
}
示例10: writeField1
func (p *RequestInfo) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err)
}
if err := oprot.WriteI32(int32(p.Type)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err)
}
return err
}
示例11: writeField3
func (p *Item) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("confidence", thrift.I32, 3); err != nil {
return fmt.Errorf("%T write field begin error 3:confidence: %s", p, err)
}
if err := oprot.WriteI32(int32(p.Confidence)); err != nil {
return fmt.Errorf("%T.confidence (3) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 3:confidence: %s", p, err)
}
return err
}
示例12: writeField3
func (p *AddTagArgs) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("resourceType", thrift.I32, 3); err != nil {
return fmt.Errorf("%T write field begin error 3:resourceType: %s", p, err)
}
if err := oprot.WriteI32(int32(p.ResourceType)); err != nil {
return fmt.Errorf("%T.resourceType (3) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 3:resourceType: %s", p, err)
}
return err
}
示例13: writeField3
func (p *Request) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("scope", thrift.I32, 3); err != nil {
return fmt.Errorf("%T write field begin error 3:scope: %s", p, err)
}
if err := oprot.WriteI32(int32(p.Scope)); err != nil {
return fmt.Errorf("%T.scope (3) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 3:scope: %s", p, err)
}
return err
}
示例14: writeField2
func (p *Request) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("start", thrift.I32, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:start: %s", p, err)
}
if err := oprot.WriteI32(int32(p.Start)); err != nil {
return fmt.Errorf("%T.start (2) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:start: %s", p, err)
}
return err
}
示例15: writeField1
func (p *QueryResult) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("queryTime", thrift.I32, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:queryTime: %s", p, err)
}
if err := oprot.WriteI32(int32(p.QueryTime)); err != nil {
return fmt.Errorf("%T.queryTime (1) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 1:queryTime: %s", p, err)
}
return err
}