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


Golang TProtocol.WriteI16方法代码示例

本文整理汇总了Golang中git/apache/org/thrift/git/lib/go/thrift.TProtocol.WriteI16方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.WriteI16方法的具体用法?Golang TProtocol.WriteI16怎么用?Golang TProtocol.WriteI16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在git/apache/org/thrift/git/lib/go/thrift.TProtocol的用法示例。


在下文中一共展示了TProtocol.WriteI16方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: writeField1

func (p *Flop) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("a", thrift.I16, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:a: %s", p, err)
	}
	if err := oprot.WriteI16(int16(p.A)); err != nil {
		return fmt.Errorf("%T.a (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:a: %s", p, err)
	}
	return err
}
开发者ID:karmakaze,项目名称:ruby-go-thrift,代码行数:12,代码来源:ttypes.go

示例2: writeField2

func (p *Flop) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("b", thrift.I16, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:b: %s", p, err)
	}
	if err := oprot.WriteI16(int16(p.B)); err != nil {
		return fmt.Errorf("%T.b (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:b: %s", p, err)
	}
	return err
}
开发者ID:karmakaze,项目名称:ruby-go-thrift,代码行数:12,代码来源:ttypes.go

示例3: writeField1

func (p *Types) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("short_value", thrift.I16, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:short_value: ", p), err)
	}
	if err := oprot.WriteI16(int16(p.ShortValue)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.short_value (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:short_value: ", p), err)
	}
	return err
}
开发者ID:y-okubo,项目名称:thrift-test,代码行数:12,代码来源:ttypes.go

示例4: writeField2

func (p *Message) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("vote_type", thrift.I16, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vote_type: ", p), err)
	}
	if err := oprot.WriteI16(int16(p.VoteType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.vote_type (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vote_type: ", p), err)
	}
	return err
}
开发者ID:wallacexinyu,项目名称:Distributed-Productivity-Calendar,代码行数:12,代码来源:ttypes.go

示例5: writeField4

func (p *Student) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sage", thrift.I16, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:sage: ", p), err)
	}
	if err := oprot.WriteI16(int16(p.Sage)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.sage (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:sage: ", p), err)
	}
	return err
}
开发者ID:wallacexinyu,项目名称:Distributed-Productivity-Calendar,代码行数:12,代码来源:ttypes.go

示例6: writeField2

func (p *Endpoint) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("port", thrift.I16, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err)
	}
	if err := oprot.WriteI16(int16(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:elodina,项目名称:go-zipkin,代码行数:12,代码来源:ttypes.go

示例7: writeField2

func (p *GetArgs) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("columnId", thrift.I16, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:columnId: %s", p, err)
	}
	if err := oprot.WriteI16(int16(p.ColumnId)); err != nil {
		return fmt.Errorf("%T.columnId (2) field write error: %s", p)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:columnId: %s", p, err)
	}
	return err
}
开发者ID:cosh,项目名称:C4,代码行数:12,代码来源:c4.go

示例8: writeField5

func (p *Person) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("age", thrift.I16, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:age: ", p), err)
	}
	if err := oprot.WriteI16(int16(p.Age)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.age (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:age: ", p), err)
	}
	return err
}
开发者ID:dynastymasra,项目名称:GolangThrift,代码行数:12,代码来源:ttypes.go

示例9: writeField0

func (p *CountResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.I16, 0); err != nil {
			return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
		}
		if err := oprot.WriteI16(int16(*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:karmakaze,项目名称:ruby-go-thrift,代码行数:14,代码来源:service.go


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