本文整理汇总了Golang中github.com/apache/thrift/lib/go/thrift.TProtocol.WriteI32方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.WriteI32方法的具体用法?Golang TProtocol.WriteI32怎么用?Golang TProtocol.WriteI32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/apache/thrift/lib/go/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteI32方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: writeField1
func (p *Endpoint) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("ipv4", thrift.I32, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ipv4: ", p), err)
}
if err := oprot.WriteI32(int32(p.Ipv4)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.ipv4 (1) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ipv4: ", p), err)
}
return err
}
示例2: writeField3
func (p *BinaryAnnotation) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("annotation_type", thrift.I32, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:annotation_type: ", p), err)
}
if err := oprot.WriteI32(int32(p.AnnotationType)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.annotation_type (3) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:annotation_type: ", p), err)
}
return err
}
示例3: writeField2
func (p *ServicePeer) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("port", thrift.I32, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err)
}
if err := oprot.WriteI32(int32(p.Port)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err)
}
return err
}
示例4: writeField3
func (p *Data) writeField3(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("i3", thrift.I32, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i3: ", p), err)
}
if err := oprot.WriteI32(int32(p.I3)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.i3 (3) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i3: ", p), err)
}
return err
}
示例5: writeField4
func (p *ServerInfo) writeField4(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("maxConn", thrift.I32, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:maxConn: ", p), err)
}
if err := oprot.WriteI32(int32(p.MaxConn)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.maxConn (4) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:maxConn: ", p), err)
}
return err
}
示例6: writeField5
func (p *ServerInfo) writeField5(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("bufferSize", thrift.I32, 5); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:bufferSize: ", p), err)
}
if err := oprot.WriteI32(int32(p.BufferSize)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.bufferSize (5) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 5:bufferSize: ", p), err)
}
return err
}
示例7: writeField7
func (p *BinaryAnnotation) writeField7(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("annotationType", thrift.I32, 7); err != nil {
return fmt.Errorf("%T write field begin error 7:annotationType: %s", p, err)
}
if err := oprot.WriteI32(int32(p.AnnotationType)); err != nil {
return fmt.Errorf("%T.annotationType (7) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 7:annotationType: %s", p, err)
}
return err
}
示例8: writeField2
func (p *Endpoint) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("port", thrift.I32, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:port: %s", p, err)
}
if err := oprot.WriteI32(int32(p.Port)); err != nil {
return fmt.Errorf("%T.port (2) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:port: %s", p, err)
}
return err
}
示例9: writeField1
func (p *InvalidOperation) 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
}
示例10: writeField3
func (p *Request) 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
}
示例11: writeField3
func (p *Annotation) writeField3(oprot thrift.TProtocol) (err error) {
if p.IsSetDuration() {
if err := oprot.WriteFieldBegin("duration", thrift.I32, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:duration: ", p), err)
}
if err := oprot.WriteI32(int32(*p.Duration)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.duration (3) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:duration: ", p), err)
}
}
return err
}
示例12: writeField4
func (p *Annotation) writeField4(oprot thrift.TProtocol) (err error) {
if p.IsSetDuration() {
if err := oprot.WriteFieldBegin("duration", thrift.I32, 4); err != nil {
return fmt.Errorf("%T write field begin error 4:duration: %s", p, err)
}
if err := oprot.WriteI32(int32(*p.Duration)); err != nil {
return fmt.Errorf("%T.duration (4) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 4:duration: %s", p, err)
}
}
return err
}
示例13: 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
}