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


Golang TProtocol.WriteFieldEnd方法代码示例

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


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

示例1: WriteField1

func (p *LogArgs) WriteField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Messages != nil {
		err = oprot.WriteFieldBegin("messages", thrift.LIST, 1)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "messages", p.ThriftName(), err)
		}
		err = oprot.WriteListBegin(thrift.STRUCT, p.Messages.Len())
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		for Iter22 := range p.Messages.Iter() {
			Iter23 := Iter22.(*LogEntry)
			err = Iter23.Write(oprot)
			if err != nil {
				return thrift.NewTProtocolExceptionWriteStruct("LogEntry", err)
			}
		}
		err = oprot.WriteListEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "messages", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:johnvilsack,项目名称:golang-stuff,代码行数:28,代码来源:scribe.go

示例2: WriteField2

func (p *LogEntry) WriteField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("message", thrift.STRING, 2)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "message", p.ThriftName(), err)
	}
	err = oprot.WriteString(string(p.Message))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "message", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "message", p.ThriftName(), err)
	}
	return err
}
开发者ID:rrudduck,项目名称:golang-stuff,代码行数:15,代码来源:ttypes.go

示例3: WriteField1

func (p *LogEntry) WriteField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("category", thrift.STRING, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "category", p.ThriftName(), err)
	}
	err = oprot.WriteString(string(p.Category))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "category", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "category", p.ThriftName(), err)
	}
	return err
}
开发者ID:rrudduck,项目名称:golang-stuff,代码行数:15,代码来源:ttypes.go

示例4: WriteField0

func (p *LogResult) WriteField0(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("success", thrift.I32, 0)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(0, "success", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.Success))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(0, "success", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(0, "success", p.ThriftName(), err)
	}
	return err
}
开发者ID:johnvilsack,项目名称:golang-stuff,代码行数:15,代码来源:scribe.go


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