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


Golang thrift.NewTProtocolExceptionWriteField函数代码示例

本文整理汇总了Golang中thrift.NewTProtocolExceptionWriteField函数的典型用法代码示例。如果您正苦于以下问题:Golang NewTProtocolExceptionWriteField函数的具体用法?Golang NewTProtocolExceptionWriteField怎么用?Golang NewTProtocolExceptionWriteField使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: WriteField2

func (p *Reservation) WriteField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("secret", thrift.STRING, 2)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "secret", p.ThriftName(), err)
	}
	err = oprot.WriteString(string(p.Secret))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "secret", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "secret", p.ThriftName(), err)
	}
	return err
}
开发者ID:paulcnichols,项目名称:BigSelect,代码行数:15,代码来源:ttypes.go

示例2: WriteField1

func (p *Reservation) WriteField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("queue", thrift.STRING, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "queue", p.ThriftName(), err)
	}
	err = oprot.WriteString(string(p.Queue))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "queue", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "queue", p.ThriftName(), err)
	}
	return err
}
开发者ID:paulcnichols,项目名称:BigSelect,代码行数:15,代码来源:ttypes.go

示例3: WriteField9

func (p *ContainerOfEnums) WriteField9(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.IsSetDefaultNineth() {
		err = oprot.WriteFieldBegin("default_nineth", thrift.I32, 9)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(9, "default_nineth", p.ThriftName(), err)
		}
		err = oprot.WriteI32(int32(p.DefaultNineth))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(9, "default_nineth", p.ThriftName(), err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(9, "default_nineth", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:benpence,项目名称:thrift4go,代码行数:17,代码来源:ttypes.go

示例4: WriteField6

func (p *ContainerOfEnums) WriteField6(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.IsSetOptionalSixth() {
		err = oprot.WriteFieldBegin("optional_sixth", thrift.I32, 6)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(6, "optional_sixth", p.ThriftName(), err)
		}
		err = oprot.WriteI32(int32(p.OptionalSixth))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(6, "optional_sixth", p.ThriftName(), err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(6, "optional_sixth", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:benpence,项目名称:thrift4go,代码行数:17,代码来源:ttypes.go

示例5: WriteField3

func (p *ContainerOfEnums) WriteField3(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.IsSetThird() {
		err = oprot.WriteFieldBegin("third", thrift.I32, 3)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(3, "third", p.ThriftName(), err)
		}
		err = oprot.WriteI32(int32(p.Third))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(3, "third", p.ThriftName(), err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(3, "third", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:benpence,项目名称:thrift4go,代码行数:17,代码来源:ttypes.go

示例6: WriteField2

func (p *ContainerOfEnums) WriteField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.IsSetSecond() {
		err = oprot.WriteFieldBegin("second", thrift.I32, 2)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(2, "second", p.ThriftName(), err)
		}
		err = oprot.WriteI32(int32(p.Second))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(2, "second", p.ThriftName(), err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(2, "second", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:benpence,项目名称:thrift4go,代码行数:17,代码来源:ttypes.go

示例7: WriteField1

func (p *ContainerOfEnums) WriteField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.IsSetFirst() {
		err = oprot.WriteFieldBegin("first", thrift.I32, 1)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "first", p.ThriftName(), err)
		}
		err = oprot.WriteI32(int32(p.First))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "first", p.ThriftName(), err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "first", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:benpence,项目名称:thrift4go,代码行数:17,代码来源:ttypes.go

示例8: WriteField0

func (p *EchoResult) WriteField0(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Success != nil {
		err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(0, "success", p.ThriftName(), err)
		}
		err = p.Success.Write(oprot)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteStruct("ContainerOfEnums", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(0, "success", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:pablo-meier,项目名称:thrift4go,代码行数:17,代码来源:ContainerOfEnumsTestService.go

示例9: WriteField1

func (p *EchoArgs) WriteField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Message != nil {
		err = oprot.WriteFieldBegin("message", thrift.STRUCT, 1)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "message", p.ThriftName(), err)
		}
		err = p.Message.Write(oprot)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteStruct("ContainerOfEnums", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "message", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:pablo-meier,项目名称:thrift4go,代码行数:17,代码来源:ContainerOfEnumsTestService.go

示例10: Write

func (p *ContainerOfEnums) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteStructBegin("ContainerOfEnums")
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
	}
	err = p.WriteField1(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField2(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField3(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField4(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField5(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField6(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField7(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField8(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField9(oprot)
	if err != nil {
		return err
	}
	err = oprot.WriteFieldStop()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(-1, "STOP", p.ThriftName(), err)
	}
	err = oprot.WriteStructEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
	}
	return err
}
开发者ID:benpence,项目名称:thrift4go,代码行数:51,代码来源:ttypes.go

示例11: Write

func (p *EchoArgs) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteStructBegin("echo_args")
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
	}
	err = p.WriteField1(oprot)
	if err != nil {
		return err
	}
	err = oprot.WriteFieldStop()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(-1, "STOP", p.ThriftName(), err)
	}
	err = oprot.WriteStructEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
	}
	return err
}
开发者ID:pablo-meier,项目名称:thrift4go,代码行数:19,代码来源:ContainerOfEnumsTestService.go


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