Esempio n. 1
0
func (p *Result) writeField2(oprot thrift.TProtocol) (err error) {
	if p.Palette != nil {
		if err := oprot.WriteFieldBegin("palette", thrift.MAP, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:palette: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Palette)); err != nil {
			return fmt.Errorf("error writing map begin: %s")
		}
		for k, v := range p.Palette {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
			if err := v.Write(oprot); err != nil {
				return fmt.Errorf("%T error writing struct: %s", v)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s")
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 2:palette: %s", p, err)
		}
	}
	return err
}
Esempio n. 2
0
func (p *ThriftFlumeEvent) writeField1(oprot thrift.TProtocol) (err error) {
	if p.Headers != nil {
		if err := oprot.WriteFieldBegin("headers", thrift.MAP, 1); err != nil {
			return fmt.Errorf("%T write field begin error 1:headers: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Headers)); err != nil {
			return fmt.Errorf("error writing map begin: %s")
		}
		for k, v := range p.Headers {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s")
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 1:headers: %s", p, err)
		}
	}
	return err
}
Esempio n. 3
0
func (p *FunCallArgs) writeField3(oprot thrift.TProtocol) (err error) {
	if p.ParamMap != nil {
		if err := oprot.WriteFieldBegin("paramMap", thrift.MAP, 3); err != nil {
			return fmt.Errorf("%T write field begin error 3:paramMap: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.ParamMap)); err != nil {
			return fmt.Errorf("error writing map begin: %s")
		}
		for k, v := range p.ParamMap {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s")
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 3:paramMap: %s", p, err)
		}
	}
	return err
}
Esempio n. 4
0
func (p *NoStdJson) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetOne() {
		if err := oprot.WriteFieldBegin("one", thrift.MAP, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:one: ", p), err)
		}
		if err := oprot.WriteMapBegin(thrift.I64, thrift.STRING, len(p.One)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.One {
			if err := oprot.WriteI64(int64(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return thrift.PrependError("error writing map end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:one: ", p), err)
		}
	}
	return err
}
Esempio n. 5
0
func (p *Types) writeField9(oprot thrift.TProtocol) (err error) {
	if p.IsSetMapValue() {
		if err := oprot.WriteFieldBegin("map_value", thrift.MAP, 9); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:map_value: ", p), err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.MapValue)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.MapValue {
			if err := oprot.WriteString(string(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := oprot.WriteI32(int32(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return thrift.PrependError("error writing map end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 9:map_value: ", p), err)
		}
	}
	return err
}
Esempio n. 6
0
func (p *Entry) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetFields() {
		if err := oprot.WriteFieldBegin("fields", thrift.MAP, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:fields: ", p), err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Fields)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.Fields {
			if err := oprot.WriteString(string(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return thrift.PrependError("error writing map end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:fields: ", p), err)
		}
	}
	return err
}
Esempio n. 7
0
func (p *Recommender) writeField10(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("itemTypes", thrift.MAP, 10); err != nil {
		return fmt.Errorf("%T write field begin error 10:itemTypes: %s", p, err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.ItemTypes)); err != nil {
		return fmt.Errorf("error writing map begin: %s", err)
	}
	for k, v := range p.ItemTypes {
		if err := oprot.WriteString(string(k)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
		if err := oprot.WriteString(string(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteMapEnd(); err != nil {
		return fmt.Errorf("error writing map end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 10:itemTypes: %s", p, err)
	}
	return err
}
Esempio n. 8
0
func (p *TestCase2Args) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("num1", thrift.MAP, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:num1: %s", p, err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Num1)); err != nil {
		return fmt.Errorf("error writing map begin: %s", err)
	}
	for k, v := range p.Num1 {
		if err := oprot.WriteString(string(k)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
		if err := oprot.WriteString(string(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteMapEnd(); err != nil {
		return fmt.Errorf("error writing map end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:num1: %s", p, err)
	}
	return err
}
Esempio n. 9
0
func (p *Blog) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("props", thrift.MAP, 6); err != nil {
		return fmt.Errorf("%T write field begin error 6:props: %s", p, err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Props)); err != nil {
		return fmt.Errorf("error writing map begin: %s", err)
	}
	for k, v := range p.Props {
		if err := oprot.WriteString(string(k)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
		if err := oprot.WriteString(string(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteMapEnd(); err != nil {
		return fmt.Errorf("error writing map end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 6:props: %s", p, err)
	}
	return err
}
Esempio n. 10
0
func (p *RpcServiceFunCallArgs) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("paramMap", thrift.MAP, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paramMap: ", p), err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.ParamMap)); err != nil {
		return thrift.PrependError("error writing map begin: ", err)
	}
	for k, v := range p.ParamMap {
		if err := oprot.WriteString(string(k)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteMapEnd(); err != nil {
		return thrift.PrependError("error writing map end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paramMap: ", p), err)
	}
	return err
}