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


Golang thrift.NewTProtocolExceptionWriteField函数代码示例

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


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

示例1: writeField4

func (p *Manylists) writeField4(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Stringlist != nil {
		err = oprot.WriteFieldBegin("stringlist", thrift.LIST, 4)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(4, "stringlist", p.ThriftName(), err)
		}
		err = oprot.WriteListBegin(thrift.STRING, len(p.Stringlist))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		for _, Iter80 := range p.Stringlist {
			err = oprot.WriteString(Iter80)
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(0, "Iter80", "", err)
			}
		}
		err = oprot.WriteListEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(4, "stringlist", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:27,代码来源:ttypes.go

示例2: writeField1

func (p *Manylists) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Bytelist != nil {
		err = oprot.WriteFieldBegin("bytelist", thrift.LIST, 1)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "bytelist", p.ThriftName(), err)
		}
		err = oprot.WriteListBegin(thrift.BYTE, len(p.Bytelist))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		for _, Iter77 := range p.Bytelist {
			err = oprot.WriteByte(int8(Iter77))
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(0, "Iter77", "", err)
			}
		}
		err = oprot.WriteListEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "bytelist", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:27,代码来源:ttypes.go

示例3: writeField2

func (p *Manylists) writeField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.I16list != nil {
		if p.IsSetI16list() {
			err = oprot.WriteFieldBegin("i16list", thrift.LIST, 2)
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(2, "i16list", p.ThriftName(), err)
			}
			err = oprot.WriteListBegin(thrift.I16, len(p.I16list))
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
			}
			for _, Iter78 := range p.I16list {
				err = oprot.WriteI16(int16(Iter78))
				if err != nil {
					return thrift.NewTProtocolExceptionWriteField(0, "Iter78", "", err)
				}
			}
			err = oprot.WriteListEnd()
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
			}
			err = oprot.WriteFieldEnd()
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(2, "i16list", p.ThriftName(), err)
			}
		}
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:29,代码来源:ttypes.go

示例4: writeField5

func (p *Manylists) writeField5(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Structlist != nil {
		err = oprot.WriteFieldBegin("structlist", thrift.LIST, 5)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(5, "structlist", p.ThriftName(), err)
		}
		err = oprot.WriteListBegin(thrift.STRUCT, len(p.Structlist))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		for _, Iter81 := range p.Structlist {
			err = Iter81.Write(oprot)
			if err != nil {
				return thrift.NewTProtocolExceptionWriteStruct("intstruct", err)
			}
		}
		err = oprot.WriteListEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(5, "structlist", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:27,代码来源:ttypes.go

示例5: writeField6

func (p *Manymaps) writeField6(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Binarstructymap != nil {
		err = oprot.WriteFieldBegin("binarstructymap", thrift.MAP, 6)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(6, "binarstructymap", p.ThriftName(), err)
		}
		err = oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Binarstructymap))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "map", err)
		}
		for Kiter91, Viter92 := range p.Binarstructymap {
			err = oprot.WriteString(Kiter91)
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(0, "Kiter91", "", err)
			}
			err = Viter92.Write(oprot)
			if err != nil {
				return thrift.NewTProtocolExceptionWriteStruct("intstruct", err)
			}
		}
		err = oprot.WriteMapEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "map", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(6, "binarstructymap", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:31,代码来源:ttypes.go

示例6: writeField3

func (p *Manylists) writeField3(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.I32list != nil {
		err = oprot.WriteFieldBegin("i32list", thrift.LIST, 3)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(3, "i32list", p.ThriftName(), err)
		}
		err = oprot.WriteListBegin(thrift.I32, len(p.I32list))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		for _, Iter79 := range p.I32list {
			err = oprot.WriteI32(int32(Iter79))
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(0, "Iter79", "", err)
			}
		}
		err = oprot.WriteListEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "list", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(3, "i32list", p.ThriftName(), err)
		}
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:27,代码来源:ttypes.go

示例7: writeField1

func (p *AddArgs) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("num1", thrift.I32, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "num1", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.Num1))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "num1", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "num1", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:Calculator.go

示例8: writeField0

func (p *CalculateResult) 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:mohanarpit,项目名称:goh,代码行数:15,代码来源:Calculator.go

示例9: writeField1

func (p *Ping) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("timestamp", thrift.I32, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "timestamp", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.Timestamp))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "timestamp", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "timestamp", p.ThriftName(), err)
	}
	return err
}
开发者ID:Digaku,项目名称:ansvia-lessons,代码行数:15,代码来源:ttypes.go

示例10: writeField3

func (p *MyMethodArgs) writeField3(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("second", thrift.I16, 3)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(3, "second", p.ThriftName(), err)
	}
	err = oprot.WriteI16(int16(p.Second))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(3, "second", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(3, "second", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:ReverseOrderService.go

示例11: writeField4

func (p *MyMethodArgs) writeField4(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("first", thrift.STRING, 4)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(4, "first", p.ThriftName(), err)
	}
	err = oprot.WriteString(p.First)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(4, "first", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(4, "first", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:ReverseOrderService.go

示例12: writeField1

func (p *MyMethodArgs) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("fourth", thrift.I64, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "fourth", p.ThriftName(), err)
	}
	err = oprot.WriteI64(int64(p.Fourth))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "fourth", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "fourth", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:ReverseOrderService.go

示例13: writeField2

func (p *MyMethodArgs) writeField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("third", thrift.I32, 2)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "third", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.Third))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "third", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "third", p.ThriftName(), err)
	}
	return err
}
开发者ID:mohanarpit,项目名称:goh,代码行数:15,代码来源:ReverseOrderService.go

示例14: Write

func (p *CalculateResult) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteStructBegin("calculate_result")
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
	}
	switch {
	case p.Ouch != nil:
		if err = p.writeField1(oprot); err != nil {
			return err
		}
	default:
		if err = p.writeField0(oprot); 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:mohanarpit,项目名称:goh,代码行数:25,代码来源:Calculator.go

示例15: Write

func (p *Work) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteStructBegin("Work")
	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 = 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:mohanarpit,项目名称:goh,代码行数:31,代码来源:ttypes.go


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