Exemplo n.º 1
0
func (p *MyMethodResult) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
	for {
		fieldName, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if fieldId < 0 {
			fieldId = int16(tstructMyMethodResult.FieldIdFromFieldName(fieldName))
			fieldTypeId = tstructMyMethodResult.FieldFromFieldName(fieldName).TypeId()
		}
		if err != nil {
			return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		default:
			err = iprot.Skip(fieldTypeId)
			if err != nil {
				return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
			}
		} //switch
		err = iprot.ReadFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
		}
	}
	err = iprot.ReadStructEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
	return err
}
Exemplo n.º 2
0
func (p *InvalidOperation) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
	for {
		fieldName, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if fieldId < 0 {
			fieldId = int16(tstructInvalidOperation.FieldIdFromFieldName(fieldName))
			fieldTypeId = tstructInvalidOperation.FieldFromFieldName(fieldName).TypeId()
		}
		if err != nil {
			return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1: //i32
			if fieldTypeId == thrift.I32 {
				err = p.readField1(iprot)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			} else {
				err = iprot.Skip(fieldTypeId)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			}
		case 2: //string
			if fieldTypeId == thrift.STRING {
				err = p.readField2(iprot)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			} else {
				err = iprot.Skip(fieldTypeId)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			}
		default:
			err = iprot.Skip(fieldTypeId)
			if err != nil {
				return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
			}
		} //switch
		err = iprot.ReadFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
		}
	}
	err = iprot.ReadStructEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
	return err
}
Exemplo n.º 3
0
func (p *Manymaps) readField6(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_ktype70, _vtype71, _size69, err := iprot.ReadMapBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadField(-1, "p.Binarstructymap", "", err)
	}
	_, _ = _ktype70, _vtype71
	p.Binarstructymap = make(map[string]*Intstruct, _size69)
	for i := 0; i < _size69; i++ {
		v76, err77 := iprot.ReadString()
		if err77 != nil {
			return thrift.NewTProtocolExceptionReadField(0, "_key74", "", err77)
		}
		_key74 := v76
		_val75 := NewIntstruct()
		err80 := _val75.Read(iprot)
		if err80 != nil {
			return thrift.NewTProtocolExceptionReadStruct("_val75intstruct", err80)
		}
		p.Binarstructymap[_key74] = _val75
	}
	err = iprot.ReadMapEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
	}
	return err
}
Exemplo n.º 4
0
func (p *CalculateResult) readField1(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	p.Ouch = NewInvalidOperation()
	err57 := p.Ouch.Read(iprot)
	if err57 != nil {
		return thrift.NewTProtocolExceptionReadStruct("p.OuchInvalidOperation", err57)
	}
	return err
}
Exemplo n.º 5
0
func (p *CalculateArgs) readField2(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	p.W = NewWork()
	err52 := p.W.Read(iprot)
	if err52 != nil {
		return thrift.NewTProtocolExceptionReadStruct("p.WWork", err52)
	}
	return err
}
Exemplo n.º 6
0
func (p *PingArgs) readField1(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	p.Ts = NewPing()
	err18 := p.Ts.Read(iprot)
	if err18 != nil {
		return thrift.NewTProtocolExceptionReadStruct("p.TsPing", err18)
	}
	return err
}
Exemplo n.º 7
0
func (p *MethodThatThrowsAnExceptionResult) readField1(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	p.Xwamap = NewExceptionWithAMap()
	err1050 := p.Xwamap.Read(iprot)
	if err1050 != nil {
		return thrift.NewTProtocolExceptionReadStruct("p.XwamapExceptionWithAMap", err1050)
	}
	return err
}
Exemplo n.º 8
0
func (p *Manylists) readField5(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_etype51, _size48, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadField(-1, "p.Structlist", "", err)
	}
	_ = _etype51
	p.Structlist = make([]*Intstruct, _size48, _size48)
	for i := 0; i < _size48; i++ {
		_elem53 := NewIntstruct()
		err56 := _elem53.Read(iprot)
		if err56 != nil {
			return thrift.NewTProtocolExceptionReadStruct("_elem53intstruct", err56)
		}
		p.Structlist[i] = _elem53
	}
	err = iprot.ReadListEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionReadField(-1, "", "list", err)
	}
	return err
}
Exemplo n.º 9
0
func (p *Manylists) Read(iprot thrift.TProtocol) (err thrift.TProtocolException) {
	_, err = iprot.ReadStructBegin()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
	for {
		fieldName, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if fieldId < 0 {
			fieldId = int16(tstructManylists.FieldIdFromFieldName(fieldName))
			fieldTypeId = tstructManylists.FieldFromFieldName(fieldName).TypeId()
		}
		if err != nil {
			return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1: //
			if fieldTypeId == thrift.LIST {
				err = p.readField1(iprot)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			} else {
				err = iprot.Skip(fieldTypeId)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			}
		case 2: //
			if fieldTypeId == thrift.LIST {
				err = p.readField2(iprot)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			} else {
				err = iprot.Skip(fieldTypeId)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			}
		case 3: //
			if fieldTypeId == thrift.LIST {
				err = p.readField3(iprot)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			} else {
				err = iprot.Skip(fieldTypeId)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			}
		case 4: //
			if fieldTypeId == thrift.LIST {
				err = p.readField4(iprot)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			} else {
				err = iprot.Skip(fieldTypeId)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			}
		case 5: //
			if fieldTypeId == thrift.LIST {
				err = p.readField5(iprot)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			} else {
				err = iprot.Skip(fieldTypeId)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			}
		case 6: //
			if fieldTypeId == thrift.LIST {
				err = p.readField6(iprot)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			} else {
				err = iprot.Skip(fieldTypeId)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			}
		case 7: //i32
			if fieldTypeId == thrift.I32 {
				err = p.readField7(iprot)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			} else {
				err = iprot.Skip(fieldTypeId)
				if err != nil {
					return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
				}
			}
		default:
			err = iprot.Skip(fieldTypeId)
			if err != nil {
				return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
			}
		} //switch
		err = iprot.ReadFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionReadField(int(fieldId), fieldName, p.ThriftName(), err)
		}
	}
	err = iprot.ReadStructEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionReadStruct(p.ThriftName(), err)
	}
	return err
}