当前位置: 首页>>代码示例>>Golang>>正文


Golang TProtocol.WriteI32方法代码示例

本文整理汇总了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
}
开发者ID:ZhuJingfa,项目名称:go-platform,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:ZhuJingfa,项目名称:go-platform,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:gosuper,项目名称:tchannel-go,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:uber,项目名称:tchannel-go,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:akaspin,项目名称:bar,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:akaspin,项目名称:bar,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:hustxiaoc,项目名称:tchannel,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:hustxiaoc,项目名称:tchannel,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:LC2010,项目名称:thrift-step-by-step-go,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:LC2010,项目名称:thrift-step-by-step-go,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:dansimau,项目名称:ringpop-go,代码行数:14,代码来源:ttypes.go

示例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
}
开发者ID:cnicolov,项目名称:kit,代码行数:14,代码来源:ttypes.go

示例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
}
开发者ID:cnicolov,项目名称:kit,代码行数:14,代码来源:scribe.go


注:本文中的github.com/apache/thrift/lib/go/thrift.TProtocol.WriteI32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。