Пример #1
0
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
}
Пример #2
0
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
}
Пример #3
0
func (p *MyMethodResult) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteStructBegin("myMethod_result")
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), 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
}
Пример #4
0
func (p *PingArgs) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteStructBegin("ping_args")
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), 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
}
Пример #5
0
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
}
Пример #6
0
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
}
Пример #7
0
func (p *AddResult) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteStructBegin("add_result")
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
	}
	switch {
	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
}
Пример #8
0
func (p *MethodThatThrowsAnExceptionResult) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteStructBegin("methodThatThrowsAnException_result")
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
	}
	switch {
	case p.Xwamap != nil:
		if err = p.writeField1(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
}
Пример #9
0
func (p *CalculateResult) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Ouch != nil {
		err = oprot.WriteFieldBegin("ouch", thrift.STRUCT, 1)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "ouch", p.ThriftName(), err)
		}
		err = p.Ouch.Write(oprot)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteStruct("InvalidOperation", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "ouch", p.ThriftName(), err)
		}
	}
	return err
}
Пример #10
0
func (p *CalculateArgs) writeField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.W != nil {
		err = oprot.WriteFieldBegin("w", thrift.STRUCT, 2)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(2, "w", p.ThriftName(), err)
		}
		err = p.W.Write(oprot)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteStruct("Work", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(2, "w", p.ThriftName(), err)
		}
	}
	return err
}
Пример #11
0
func (p *PingArgs) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Ts != nil {
		err = oprot.WriteFieldBegin("ts", thrift.STRUCT, 1)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "ts", p.ThriftName(), err)
		}
		err = p.Ts.Write(oprot)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteStruct("Ping", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "ts", p.ThriftName(), err)
		}
	}
	return err
}
Пример #12
0
func (p *MethodThatThrowsAnExceptionResult) writeField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if p.Xwamap != nil {
		err = oprot.WriteFieldBegin("xwamap", thrift.STRUCT, 1)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "xwamap", p.ThriftName(), err)
		}
		err = p.Xwamap.Write(oprot)
		if err != nil {
			return thrift.NewTProtocolExceptionWriteStruct("ExceptionWithAMap", err)
		}
		err = oprot.WriteFieldEnd()
		if err != nil {
			return thrift.NewTProtocolExceptionWriteField(1, "xwamap", p.ThriftName(), err)
		}
	}
	return err
}