Beispiel #1
0
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
}
Beispiel #2
0
func (p *Manymaps) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Bytemap != nil {
		err = oprot.WriteFieldBegin("bytemap", thrift.MAP, 1)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "bytemap", p.ThriftName(), err)
		}
		err = oprot.WriteMapBegin(thrift.BYTE, thrift.STRING, len(p.Bytemap))
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "map", err)
		}
		for Kiter81, Viter82 := range p.Bytemap {
			err = oprot.WriteByte(int8(Kiter81))
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(0, "Kiter81", "", err)
			}
			err = oprot.WriteString(Viter82)
			if err != nil {
				return thrift.NewTProtocolExceptionWriteField(0, "Viter82", "", err)
			}
		}
		err = oprot.WriteMapEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(-1, "", "map", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "bytemap", p.ThriftName(), err)
		}
	}
	return err
}