Пример #1
0
func (p *MonitoringCollectArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("metrics", thrift.LIST, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:metrics: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Metrics)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Metrics {
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:metrics: ", p), err)
	}
	return err
}