github.com/thanos-io/thanos@v0.32.5/internal/cortex/cortexpb/cortex.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cortex.proto 3 4 package cortexpb 5 6 import ( 7 bytes "bytes" 8 encoding_binary "encoding/binary" 9 fmt "fmt" 10 _ "github.com/gogo/protobuf/gogoproto" 11 proto "github.com/gogo/protobuf/proto" 12 io "io" 13 math "math" 14 math_bits "math/bits" 15 reflect "reflect" 16 strconv "strconv" 17 strings "strings" 18 ) 19 20 // Reference imports to suppress errors if they are not otherwise used. 21 var _ = proto.Marshal 22 var _ = fmt.Errorf 23 var _ = math.Inf 24 25 // This is a compile-time assertion to ensure that this generated file 26 // is compatible with the proto package it is being compiled against. 27 // A compilation error at this line likely means your copy of the 28 // proto package needs to be updated. 29 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 30 31 type WriteRequest_SourceEnum int32 32 33 const ( 34 API WriteRequest_SourceEnum = 0 35 RULE WriteRequest_SourceEnum = 1 36 ) 37 38 var WriteRequest_SourceEnum_name = map[int32]string{ 39 0: "API", 40 1: "RULE", 41 } 42 43 var WriteRequest_SourceEnum_value = map[string]int32{ 44 "API": 0, 45 "RULE": 1, 46 } 47 48 func (WriteRequest_SourceEnum) EnumDescriptor() ([]byte, []int) { 49 return fileDescriptor_893a47d0a749d749, []int{0, 0} 50 } 51 52 type MetricMetadata_MetricType int32 53 54 const ( 55 UNKNOWN MetricMetadata_MetricType = 0 56 COUNTER MetricMetadata_MetricType = 1 57 GAUGE MetricMetadata_MetricType = 2 58 HISTOGRAM MetricMetadata_MetricType = 3 59 GAUGEHISTOGRAM MetricMetadata_MetricType = 4 60 SUMMARY MetricMetadata_MetricType = 5 61 INFO MetricMetadata_MetricType = 6 62 STATESET MetricMetadata_MetricType = 7 63 ) 64 65 var MetricMetadata_MetricType_name = map[int32]string{ 66 0: "UNKNOWN", 67 1: "COUNTER", 68 2: "GAUGE", 69 3: "HISTOGRAM", 70 4: "GAUGEHISTOGRAM", 71 5: "SUMMARY", 72 6: "INFO", 73 7: "STATESET", 74 } 75 76 var MetricMetadata_MetricType_value = map[string]int32{ 77 "UNKNOWN": 0, 78 "COUNTER": 1, 79 "GAUGE": 2, 80 "HISTOGRAM": 3, 81 "GAUGEHISTOGRAM": 4, 82 "SUMMARY": 5, 83 "INFO": 6, 84 "STATESET": 7, 85 } 86 87 func (MetricMetadata_MetricType) EnumDescriptor() ([]byte, []int) { 88 return fileDescriptor_893a47d0a749d749, []int{5, 0} 89 } 90 91 type WriteRequest struct { 92 Timeseries []PreallocTimeseries `protobuf:"bytes,1,rep,name=timeseries,proto3,customtype=PreallocTimeseries" json:"timeseries"` 93 Source WriteRequest_SourceEnum `protobuf:"varint,2,opt,name=Source,proto3,enum=cortexpb.WriteRequest_SourceEnum" json:"Source,omitempty"` 94 Metadata []*MetricMetadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty"` 95 SkipLabelNameValidation bool `protobuf:"varint,1000,opt,name=skip_label_name_validation,json=skipLabelNameValidation,proto3" json:"skip_label_name_validation,omitempty"` 96 } 97 98 func (m *WriteRequest) Reset() { *m = WriteRequest{} } 99 func (*WriteRequest) ProtoMessage() {} 100 func (*WriteRequest) Descriptor() ([]byte, []int) { 101 return fileDescriptor_893a47d0a749d749, []int{0} 102 } 103 func (m *WriteRequest) XXX_Unmarshal(b []byte) error { 104 return m.Unmarshal(b) 105 } 106 func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 107 if deterministic { 108 return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) 109 } else { 110 b = b[:cap(b)] 111 n, err := m.MarshalToSizedBuffer(b) 112 if err != nil { 113 return nil, err 114 } 115 return b[:n], nil 116 } 117 } 118 func (m *WriteRequest) XXX_Merge(src proto.Message) { 119 xxx_messageInfo_WriteRequest.Merge(m, src) 120 } 121 func (m *WriteRequest) XXX_Size() int { 122 return m.Size() 123 } 124 func (m *WriteRequest) XXX_DiscardUnknown() { 125 xxx_messageInfo_WriteRequest.DiscardUnknown(m) 126 } 127 128 var xxx_messageInfo_WriteRequest proto.InternalMessageInfo 129 130 func (m *WriteRequest) GetSource() WriteRequest_SourceEnum { 131 if m != nil { 132 return m.Source 133 } 134 return API 135 } 136 137 func (m *WriteRequest) GetMetadata() []*MetricMetadata { 138 if m != nil { 139 return m.Metadata 140 } 141 return nil 142 } 143 144 func (m *WriteRequest) GetSkipLabelNameValidation() bool { 145 if m != nil { 146 return m.SkipLabelNameValidation 147 } 148 return false 149 } 150 151 type WriteResponse struct { 152 } 153 154 func (m *WriteResponse) Reset() { *m = WriteResponse{} } 155 func (*WriteResponse) ProtoMessage() {} 156 func (*WriteResponse) Descriptor() ([]byte, []int) { 157 return fileDescriptor_893a47d0a749d749, []int{1} 158 } 159 func (m *WriteResponse) XXX_Unmarshal(b []byte) error { 160 return m.Unmarshal(b) 161 } 162 func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 163 if deterministic { 164 return xxx_messageInfo_WriteResponse.Marshal(b, m, deterministic) 165 } else { 166 b = b[:cap(b)] 167 n, err := m.MarshalToSizedBuffer(b) 168 if err != nil { 169 return nil, err 170 } 171 return b[:n], nil 172 } 173 } 174 func (m *WriteResponse) XXX_Merge(src proto.Message) { 175 xxx_messageInfo_WriteResponse.Merge(m, src) 176 } 177 func (m *WriteResponse) XXX_Size() int { 178 return m.Size() 179 } 180 func (m *WriteResponse) XXX_DiscardUnknown() { 181 xxx_messageInfo_WriteResponse.DiscardUnknown(m) 182 } 183 184 var xxx_messageInfo_WriteResponse proto.InternalMessageInfo 185 186 type TimeSeries struct { 187 Labels []LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=LabelAdapter" json:"labels"` 188 // Sorted by time, oldest sample first. 189 Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` 190 Exemplars []Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"` 191 } 192 193 func (m *TimeSeries) Reset() { *m = TimeSeries{} } 194 func (*TimeSeries) ProtoMessage() {} 195 func (*TimeSeries) Descriptor() ([]byte, []int) { 196 return fileDescriptor_893a47d0a749d749, []int{2} 197 } 198 func (m *TimeSeries) XXX_Unmarshal(b []byte) error { 199 return m.Unmarshal(b) 200 } 201 func (m *TimeSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 202 if deterministic { 203 return xxx_messageInfo_TimeSeries.Marshal(b, m, deterministic) 204 } else { 205 b = b[:cap(b)] 206 n, err := m.MarshalToSizedBuffer(b) 207 if err != nil { 208 return nil, err 209 } 210 return b[:n], nil 211 } 212 } 213 func (m *TimeSeries) XXX_Merge(src proto.Message) { 214 xxx_messageInfo_TimeSeries.Merge(m, src) 215 } 216 func (m *TimeSeries) XXX_Size() int { 217 return m.Size() 218 } 219 func (m *TimeSeries) XXX_DiscardUnknown() { 220 xxx_messageInfo_TimeSeries.DiscardUnknown(m) 221 } 222 223 var xxx_messageInfo_TimeSeries proto.InternalMessageInfo 224 225 func (m *TimeSeries) GetSamples() []Sample { 226 if m != nil { 227 return m.Samples 228 } 229 return nil 230 } 231 232 func (m *TimeSeries) GetExemplars() []Exemplar { 233 if m != nil { 234 return m.Exemplars 235 } 236 return nil 237 } 238 239 type LabelPair struct { 240 Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 241 Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` 242 } 243 244 func (m *LabelPair) Reset() { *m = LabelPair{} } 245 func (*LabelPair) ProtoMessage() {} 246 func (*LabelPair) Descriptor() ([]byte, []int) { 247 return fileDescriptor_893a47d0a749d749, []int{3} 248 } 249 func (m *LabelPair) XXX_Unmarshal(b []byte) error { 250 return m.Unmarshal(b) 251 } 252 func (m *LabelPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 253 if deterministic { 254 return xxx_messageInfo_LabelPair.Marshal(b, m, deterministic) 255 } else { 256 b = b[:cap(b)] 257 n, err := m.MarshalToSizedBuffer(b) 258 if err != nil { 259 return nil, err 260 } 261 return b[:n], nil 262 } 263 } 264 func (m *LabelPair) XXX_Merge(src proto.Message) { 265 xxx_messageInfo_LabelPair.Merge(m, src) 266 } 267 func (m *LabelPair) XXX_Size() int { 268 return m.Size() 269 } 270 func (m *LabelPair) XXX_DiscardUnknown() { 271 xxx_messageInfo_LabelPair.DiscardUnknown(m) 272 } 273 274 var xxx_messageInfo_LabelPair proto.InternalMessageInfo 275 276 func (m *LabelPair) GetName() []byte { 277 if m != nil { 278 return m.Name 279 } 280 return nil 281 } 282 283 func (m *LabelPair) GetValue() []byte { 284 if m != nil { 285 return m.Value 286 } 287 return nil 288 } 289 290 type Sample struct { 291 Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` 292 TimestampMs int64 `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` 293 } 294 295 func (m *Sample) Reset() { *m = Sample{} } 296 func (*Sample) ProtoMessage() {} 297 func (*Sample) Descriptor() ([]byte, []int) { 298 return fileDescriptor_893a47d0a749d749, []int{4} 299 } 300 func (m *Sample) XXX_Unmarshal(b []byte) error { 301 return m.Unmarshal(b) 302 } 303 func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 304 if deterministic { 305 return xxx_messageInfo_Sample.Marshal(b, m, deterministic) 306 } else { 307 b = b[:cap(b)] 308 n, err := m.MarshalToSizedBuffer(b) 309 if err != nil { 310 return nil, err 311 } 312 return b[:n], nil 313 } 314 } 315 func (m *Sample) XXX_Merge(src proto.Message) { 316 xxx_messageInfo_Sample.Merge(m, src) 317 } 318 func (m *Sample) XXX_Size() int { 319 return m.Size() 320 } 321 func (m *Sample) XXX_DiscardUnknown() { 322 xxx_messageInfo_Sample.DiscardUnknown(m) 323 } 324 325 var xxx_messageInfo_Sample proto.InternalMessageInfo 326 327 func (m *Sample) GetValue() float64 { 328 if m != nil { 329 return m.Value 330 } 331 return 0 332 } 333 334 func (m *Sample) GetTimestampMs() int64 { 335 if m != nil { 336 return m.TimestampMs 337 } 338 return 0 339 } 340 341 type MetricMetadata struct { 342 Type MetricMetadata_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=cortexpb.MetricMetadata_MetricType" json:"type,omitempty"` 343 MetricFamilyName string `protobuf:"bytes,2,opt,name=metric_family_name,json=metricFamilyName,proto3" json:"metric_family_name,omitempty"` 344 Help string `protobuf:"bytes,4,opt,name=help,proto3" json:"help,omitempty"` 345 Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"` 346 } 347 348 func (m *MetricMetadata) Reset() { *m = MetricMetadata{} } 349 func (*MetricMetadata) ProtoMessage() {} 350 func (*MetricMetadata) Descriptor() ([]byte, []int) { 351 return fileDescriptor_893a47d0a749d749, []int{5} 352 } 353 func (m *MetricMetadata) XXX_Unmarshal(b []byte) error { 354 return m.Unmarshal(b) 355 } 356 func (m *MetricMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 357 if deterministic { 358 return xxx_messageInfo_MetricMetadata.Marshal(b, m, deterministic) 359 } else { 360 b = b[:cap(b)] 361 n, err := m.MarshalToSizedBuffer(b) 362 if err != nil { 363 return nil, err 364 } 365 return b[:n], nil 366 } 367 } 368 func (m *MetricMetadata) XXX_Merge(src proto.Message) { 369 xxx_messageInfo_MetricMetadata.Merge(m, src) 370 } 371 func (m *MetricMetadata) XXX_Size() int { 372 return m.Size() 373 } 374 func (m *MetricMetadata) XXX_DiscardUnknown() { 375 xxx_messageInfo_MetricMetadata.DiscardUnknown(m) 376 } 377 378 var xxx_messageInfo_MetricMetadata proto.InternalMessageInfo 379 380 func (m *MetricMetadata) GetType() MetricMetadata_MetricType { 381 if m != nil { 382 return m.Type 383 } 384 return UNKNOWN 385 } 386 387 func (m *MetricMetadata) GetMetricFamilyName() string { 388 if m != nil { 389 return m.MetricFamilyName 390 } 391 return "" 392 } 393 394 func (m *MetricMetadata) GetHelp() string { 395 if m != nil { 396 return m.Help 397 } 398 return "" 399 } 400 401 func (m *MetricMetadata) GetUnit() string { 402 if m != nil { 403 return m.Unit 404 } 405 return "" 406 } 407 408 type Metric struct { 409 Labels []LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=LabelAdapter" json:"labels"` 410 } 411 412 func (m *Metric) Reset() { *m = Metric{} } 413 func (*Metric) ProtoMessage() {} 414 func (*Metric) Descriptor() ([]byte, []int) { 415 return fileDescriptor_893a47d0a749d749, []int{6} 416 } 417 func (m *Metric) XXX_Unmarshal(b []byte) error { 418 return m.Unmarshal(b) 419 } 420 func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 421 if deterministic { 422 return xxx_messageInfo_Metric.Marshal(b, m, deterministic) 423 } else { 424 b = b[:cap(b)] 425 n, err := m.MarshalToSizedBuffer(b) 426 if err != nil { 427 return nil, err 428 } 429 return b[:n], nil 430 } 431 } 432 func (m *Metric) XXX_Merge(src proto.Message) { 433 xxx_messageInfo_Metric.Merge(m, src) 434 } 435 func (m *Metric) XXX_Size() int { 436 return m.Size() 437 } 438 func (m *Metric) XXX_DiscardUnknown() { 439 xxx_messageInfo_Metric.DiscardUnknown(m) 440 } 441 442 var xxx_messageInfo_Metric proto.InternalMessageInfo 443 444 type Exemplar struct { 445 // Exemplar labels, different than series labels 446 Labels []LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=LabelAdapter" json:"labels"` 447 Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` 448 TimestampMs int64 `protobuf:"varint,3,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` 449 } 450 451 func (m *Exemplar) Reset() { *m = Exemplar{} } 452 func (*Exemplar) ProtoMessage() {} 453 func (*Exemplar) Descriptor() ([]byte, []int) { 454 return fileDescriptor_893a47d0a749d749, []int{7} 455 } 456 func (m *Exemplar) XXX_Unmarshal(b []byte) error { 457 return m.Unmarshal(b) 458 } 459 func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 460 if deterministic { 461 return xxx_messageInfo_Exemplar.Marshal(b, m, deterministic) 462 } else { 463 b = b[:cap(b)] 464 n, err := m.MarshalToSizedBuffer(b) 465 if err != nil { 466 return nil, err 467 } 468 return b[:n], nil 469 } 470 } 471 func (m *Exemplar) XXX_Merge(src proto.Message) { 472 xxx_messageInfo_Exemplar.Merge(m, src) 473 } 474 func (m *Exemplar) XXX_Size() int { 475 return m.Size() 476 } 477 func (m *Exemplar) XXX_DiscardUnknown() { 478 xxx_messageInfo_Exemplar.DiscardUnknown(m) 479 } 480 481 var xxx_messageInfo_Exemplar proto.InternalMessageInfo 482 483 func (m *Exemplar) GetValue() float64 { 484 if m != nil { 485 return m.Value 486 } 487 return 0 488 } 489 490 func (m *Exemplar) GetTimestampMs() int64 { 491 if m != nil { 492 return m.TimestampMs 493 } 494 return 0 495 } 496 497 func init() { 498 proto.RegisterType((*TimeSeries)(nil), "cortexpb.TimeSeries") 499 proto.RegisterType((*LabelPair)(nil), "cortexpb.LabelPair") 500 proto.RegisterType((*Sample)(nil), "cortexpb.Sample") 501 proto.RegisterType((*MetricMetadata)(nil), "cortexpb.MetricMetadata") 502 proto.RegisterType((*Metric)(nil), "cortexpb.Metric") 503 proto.RegisterType((*Exemplar)(nil), "cortexpb.Exemplar") 504 } 505 506 func init() { proto.RegisterFile("cortex.proto", fileDescriptor_893a47d0a749d749) } 507 508 var fileDescriptor_893a47d0a749d749 = []byte{ 509 // 697 bytes of a gzipped FileDescriptorProto 510 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4f, 0x4f, 0xdb, 0x4a, 511 0x10, 0xf7, 0xe6, 0x7f, 0x86, 0x90, 0x67, 0xed, 0x43, 0x7a, 0x16, 0x07, 0x27, 0xf8, 0x5d, 0x72, 512 0x78, 0x2f, 0x54, 0x54, 0x6d, 0xd5, 0xaa, 0xaa, 0xe4, 0x54, 0x81, 0x22, 0xc8, 0x1f, 0x6d, 0x9c, 513 0xa2, 0xf6, 0x12, 0x6d, 0xc2, 0x02, 0x56, 0xed, 0xd8, 0xb5, 0xd7, 0x88, 0xdc, 0x7a, 0xea, 0xb9, 514 0xe7, 0x7e, 0x82, 0x7e, 0x82, 0x4a, 0xfd, 0x06, 0x1c, 0x39, 0xa2, 0x1e, 0x50, 0x31, 0x17, 0x8e, 515 0x7c, 0x84, 0xca, 0x6b, 0x27, 0x06, 0x55, 0xdc, 0xb8, 0xcd, 0xcc, 0x6f, 0x7e, 0x33, 0xb3, 0xf3, 516 0x1b, 0x2d, 0x54, 0x26, 0x8e, 0xc7, 0xd9, 0x49, 0xd3, 0xf5, 0x1c, 0xee, 0xe0, 0x52, 0xec, 0xb9, 517 0xe3, 0xd5, 0xff, 0x0f, 0x4d, 0x7e, 0x14, 0x8c, 0x9b, 0x13, 0xc7, 0x5e, 0x3f, 0x74, 0x0e, 0x9d, 518 0x75, 0x91, 0x30, 0x0e, 0x0e, 0x84, 0x27, 0x1c, 0x61, 0xc5, 0x44, 0xed, 0x7b, 0x06, 0x2a, 0x7b, 519 0x9e, 0xc9, 0x19, 0x61, 0x1f, 0x03, 0xe6, 0x73, 0xdc, 0x07, 0xe0, 0xa6, 0xcd, 0x7c, 0xe6, 0x99, 520 0xcc, 0x57, 0x50, 0x3d, 0xdb, 0x58, 0xda, 0x58, 0x69, 0xce, 0xcb, 0x37, 0x0d, 0xd3, 0x66, 0x03, 521 0x81, 0xb5, 0x56, 0x4f, 0x2f, 0x6a, 0xd2, 0xcf, 0x8b, 0x1a, 0xee, 0x7b, 0x8c, 0x5a, 0x96, 0x33, 522 0x31, 0x16, 0x3c, 0x72, 0xab, 0x06, 0x7e, 0x0e, 0x85, 0x81, 0x13, 0x78, 0x13, 0xa6, 0x64, 0xea, 523 0xa8, 0x51, 0xdd, 0x58, 0x4b, 0xab, 0xdd, 0xee, 0xdc, 0x8c, 0x93, 0xda, 0xd3, 0xc0, 0x26, 0x09, 524 0x01, 0xbf, 0x80, 0x92, 0xcd, 0x38, 0xdd, 0xa7, 0x9c, 0x2a, 0x59, 0x31, 0x8a, 0x92, 0x92, 0x3b, 525 0x8c, 0x7b, 0xe6, 0xa4, 0x93, 0xe0, 0xad, 0xdc, 0xe9, 0x45, 0x0d, 0x91, 0x45, 0x3e, 0x7e, 0x09, 526 0xab, 0xfe, 0x07, 0xd3, 0x1d, 0x59, 0x74, 0xcc, 0xac, 0xd1, 0x94, 0xda, 0x6c, 0x74, 0x4c, 0x2d, 527 0x73, 0x9f, 0x72, 0xd3, 0x99, 0x2a, 0xd7, 0xc5, 0x3a, 0x6a, 0x94, 0xc8, 0x3f, 0x51, 0xca, 0x6e, 528 0x94, 0xd1, 0xa5, 0x36, 0x7b, 0xbb, 0xc0, 0xb5, 0x1a, 0x40, 0x3a, 0x0f, 0x2e, 0x42, 0x56, 0xef, 529 0x6f, 0xcb, 0x12, 0x2e, 0x41, 0x8e, 0x0c, 0x77, 0xdb, 0x32, 0xd2, 0xfe, 0x82, 0xe5, 0x64, 0x7a, 530 0xdf, 0x75, 0xa6, 0x3e, 0xd3, 0x7e, 0x20, 0x80, 0x74, 0x3b, 0x58, 0x87, 0x82, 0xe8, 0x3c, 0xdf, 531 0xe1, 0xdf, 0xe9, 0xe0, 0xa2, 0x5f, 0x9f, 0x9a, 0x5e, 0x6b, 0x25, 0x59, 0x61, 0x45, 0x84, 0xf4, 532 0x7d, 0xea, 0x72, 0xe6, 0x91, 0x84, 0x88, 0x1f, 0x41, 0xd1, 0xa7, 0xb6, 0x6b, 0x31, 0x5f, 0xc9, 533 0x88, 0x1a, 0x72, 0x5a, 0x63, 0x20, 0x00, 0xf1, 0x68, 0x89, 0xcc, 0xd3, 0xf0, 0x53, 0x28, 0xb3, 534 0x13, 0x66, 0xbb, 0x16, 0xf5, 0xfc, 0x64, 0x61, 0x38, 0xe5, 0xb4, 0x13, 0x28, 0x61, 0xa5, 0xa9, 535 0xda, 0x13, 0x28, 0x2f, 0x86, 0xc2, 0x18, 0x72, 0xd1, 0xb6, 0x14, 0x54, 0x47, 0x8d, 0x0a, 0x11, 536 0x36, 0x5e, 0x81, 0xfc, 0x31, 0xb5, 0x82, 0x58, 0xc2, 0x0a, 0x89, 0x1d, 0x4d, 0x87, 0x42, 0x3c, 537 0x47, 0x8a, 0x47, 0x24, 0x94, 0xe0, 0x78, 0x0d, 0x2a, 0xe2, 0x0e, 0x38, 0xb5, 0xdd, 0x91, 0xed, 538 0x0b, 0x72, 0x96, 0x2c, 0x2d, 0x62, 0x1d, 0x5f, 0xfb, 0x9a, 0x81, 0xea, 0x5d, 0x21, 0xf1, 0x33, 539 0xc8, 0xf1, 0x99, 0x1b, 0x97, 0xaa, 0x6e, 0xfc, 0x7b, 0x9f, 0xe0, 0x89, 0x6b, 0xcc, 0x5c, 0x46, 540 0x04, 0x01, 0xff, 0x07, 0xd8, 0x16, 0xb1, 0xd1, 0x01, 0xb5, 0x4d, 0x6b, 0x26, 0x44, 0x17, 0x4d, 541 0xcb, 0x44, 0x8e, 0x91, 0x4d, 0x01, 0x44, 0x5a, 0x47, 0xcf, 0x3c, 0x62, 0x96, 0xab, 0xe4, 0x04, 542 0x2e, 0xec, 0x28, 0x16, 0x4c, 0x4d, 0xae, 0xe4, 0xe3, 0x58, 0x64, 0x6b, 0x33, 0x80, 0xb4, 0x13, 543 0x5e, 0x82, 0xe2, 0xb0, 0xbb, 0xd3, 0xed, 0xed, 0x75, 0x65, 0x29, 0x72, 0x5e, 0xf7, 0x86, 0x5d, 544 0xa3, 0x4d, 0x64, 0x84, 0xcb, 0x90, 0xdf, 0xd2, 0x87, 0x5b, 0x6d, 0x39, 0x83, 0x97, 0xa1, 0xfc, 545 0x66, 0x7b, 0x60, 0xf4, 0xb6, 0x88, 0xde, 0x91, 0xb3, 0x18, 0x43, 0x55, 0x20, 0x69, 0x2c, 0x17, 546 0x51, 0x07, 0xc3, 0x4e, 0x47, 0x27, 0xef, 0xe4, 0x7c, 0x74, 0x55, 0xdb, 0xdd, 0xcd, 0x9e, 0x5c, 547 0xc0, 0x15, 0x28, 0x0d, 0x0c, 0xdd, 0x68, 0x0f, 0xda, 0x86, 0x5c, 0xd4, 0x76, 0xa0, 0x10, 0xb7, 548 0x7e, 0x80, 0x6b, 0xd2, 0x3e, 0x23, 0x28, 0xcd, 0x2f, 0xe0, 0x21, 0xae, 0xf3, 0xce, 0x49, 0xdc, 549 0x2b, 0x79, 0xf6, 0x0f, 0xc9, 0x5b, 0xaf, 0xce, 0x2e, 0x55, 0xe9, 0xfc, 0x52, 0x95, 0x6e, 0x2e, 550 0x55, 0xf4, 0x29, 0x54, 0xd1, 0xb7, 0x50, 0x45, 0xa7, 0xa1, 0x8a, 0xce, 0x42, 0x15, 0xfd, 0x0a, 551 0x55, 0x74, 0x1d, 0xaa, 0xd2, 0x4d, 0xa8, 0xa2, 0x2f, 0x57, 0xaa, 0x74, 0x76, 0xa5, 0x4a, 0xe7, 552 0x57, 0xaa, 0xf4, 0x7e, 0xf1, 0xc3, 0x8d, 0x0b, 0xe2, 0xe7, 0x7a, 0xfc, 0x3b, 0x00, 0x00, 0xff, 553 0xff, 0x04, 0x70, 0x7e, 0x13, 0x02, 0x05, 0x00, 0x00, 554 } 555 556 func (x WriteRequest_SourceEnum) String() string { 557 s, ok := WriteRequest_SourceEnum_name[int32(x)] 558 if ok { 559 return s 560 } 561 return strconv.Itoa(int(x)) 562 } 563 func (x MetricMetadata_MetricType) String() string { 564 s, ok := MetricMetadata_MetricType_name[int32(x)] 565 if ok { 566 return s 567 } 568 return strconv.Itoa(int(x)) 569 } 570 func (this *WriteRequest) Equal(that interface{}) bool { 571 if that == nil { 572 return this == nil 573 } 574 575 that1, ok := that.(*WriteRequest) 576 if !ok { 577 that2, ok := that.(WriteRequest) 578 if ok { 579 that1 = &that2 580 } else { 581 return false 582 } 583 } 584 if that1 == nil { 585 return this == nil 586 } else if this == nil { 587 return false 588 } 589 if len(this.Timeseries) != len(that1.Timeseries) { 590 return false 591 } 592 for i := range this.Timeseries { 593 if !this.Timeseries[i].Equal(that1.Timeseries[i]) { 594 return false 595 } 596 } 597 if this.Source != that1.Source { 598 return false 599 } 600 if len(this.Metadata) != len(that1.Metadata) { 601 return false 602 } 603 for i := range this.Metadata { 604 if !this.Metadata[i].Equal(that1.Metadata[i]) { 605 return false 606 } 607 } 608 if this.SkipLabelNameValidation != that1.SkipLabelNameValidation { 609 return false 610 } 611 return true 612 } 613 func (this *WriteResponse) Equal(that interface{}) bool { 614 if that == nil { 615 return this == nil 616 } 617 618 that1, ok := that.(*WriteResponse) 619 if !ok { 620 that2, ok := that.(WriteResponse) 621 if ok { 622 that1 = &that2 623 } else { 624 return false 625 } 626 } 627 if that1 == nil { 628 return this == nil 629 } else if this == nil { 630 return false 631 } 632 return true 633 } 634 func (this *TimeSeries) Equal(that interface{}) bool { 635 if that == nil { 636 return this == nil 637 } 638 639 that1, ok := that.(*TimeSeries) 640 if !ok { 641 that2, ok := that.(TimeSeries) 642 if ok { 643 that1 = &that2 644 } else { 645 return false 646 } 647 } 648 if that1 == nil { 649 return this == nil 650 } else if this == nil { 651 return false 652 } 653 if len(this.Labels) != len(that1.Labels) { 654 return false 655 } 656 for i := range this.Labels { 657 if !this.Labels[i].Equal(that1.Labels[i]) { 658 return false 659 } 660 } 661 if len(this.Samples) != len(that1.Samples) { 662 return false 663 } 664 for i := range this.Samples { 665 if !this.Samples[i].Equal(&that1.Samples[i]) { 666 return false 667 } 668 } 669 if len(this.Exemplars) != len(that1.Exemplars) { 670 return false 671 } 672 for i := range this.Exemplars { 673 if !this.Exemplars[i].Equal(&that1.Exemplars[i]) { 674 return false 675 } 676 } 677 return true 678 } 679 func (this *LabelPair) Equal(that interface{}) bool { 680 if that == nil { 681 return this == nil 682 } 683 684 that1, ok := that.(*LabelPair) 685 if !ok { 686 that2, ok := that.(LabelPair) 687 if ok { 688 that1 = &that2 689 } else { 690 return false 691 } 692 } 693 if that1 == nil { 694 return this == nil 695 } else if this == nil { 696 return false 697 } 698 if !bytes.Equal(this.Name, that1.Name) { 699 return false 700 } 701 if !bytes.Equal(this.Value, that1.Value) { 702 return false 703 } 704 return true 705 } 706 func (this *Sample) Equal(that interface{}) bool { 707 if that == nil { 708 return this == nil 709 } 710 711 that1, ok := that.(*Sample) 712 if !ok { 713 that2, ok := that.(Sample) 714 if ok { 715 that1 = &that2 716 } else { 717 return false 718 } 719 } 720 if that1 == nil { 721 return this == nil 722 } else if this == nil { 723 return false 724 } 725 if this.Value != that1.Value { 726 return false 727 } 728 if this.TimestampMs != that1.TimestampMs { 729 return false 730 } 731 return true 732 } 733 func (this *MetricMetadata) Equal(that interface{}) bool { 734 if that == nil { 735 return this == nil 736 } 737 738 that1, ok := that.(*MetricMetadata) 739 if !ok { 740 that2, ok := that.(MetricMetadata) 741 if ok { 742 that1 = &that2 743 } else { 744 return false 745 } 746 } 747 if that1 == nil { 748 return this == nil 749 } else if this == nil { 750 return false 751 } 752 if this.Type != that1.Type { 753 return false 754 } 755 if this.MetricFamilyName != that1.MetricFamilyName { 756 return false 757 } 758 if this.Help != that1.Help { 759 return false 760 } 761 if this.Unit != that1.Unit { 762 return false 763 } 764 return true 765 } 766 func (this *Metric) Equal(that interface{}) bool { 767 if that == nil { 768 return this == nil 769 } 770 771 that1, ok := that.(*Metric) 772 if !ok { 773 that2, ok := that.(Metric) 774 if ok { 775 that1 = &that2 776 } else { 777 return false 778 } 779 } 780 if that1 == nil { 781 return this == nil 782 } else if this == nil { 783 return false 784 } 785 if len(this.Labels) != len(that1.Labels) { 786 return false 787 } 788 for i := range this.Labels { 789 if !this.Labels[i].Equal(that1.Labels[i]) { 790 return false 791 } 792 } 793 return true 794 } 795 func (this *Exemplar) Equal(that interface{}) bool { 796 if that == nil { 797 return this == nil 798 } 799 800 that1, ok := that.(*Exemplar) 801 if !ok { 802 that2, ok := that.(Exemplar) 803 if ok { 804 that1 = &that2 805 } else { 806 return false 807 } 808 } 809 if that1 == nil { 810 return this == nil 811 } else if this == nil { 812 return false 813 } 814 if len(this.Labels) != len(that1.Labels) { 815 return false 816 } 817 for i := range this.Labels { 818 if !this.Labels[i].Equal(that1.Labels[i]) { 819 return false 820 } 821 } 822 if this.Value != that1.Value { 823 return false 824 } 825 if this.TimestampMs != that1.TimestampMs { 826 return false 827 } 828 return true 829 } 830 func (this *WriteRequest) GoString() string { 831 if this == nil { 832 return "nil" 833 } 834 s := make([]string, 0, 8) 835 s = append(s, "&cortexpb.WriteRequest{") 836 s = append(s, "Timeseries: "+fmt.Sprintf("%#v", this.Timeseries)+",\n") 837 s = append(s, "Source: "+fmt.Sprintf("%#v", this.Source)+",\n") 838 if this.Metadata != nil { 839 s = append(s, "Metadata: "+fmt.Sprintf("%#v", this.Metadata)+",\n") 840 } 841 s = append(s, "SkipLabelNameValidation: "+fmt.Sprintf("%#v", this.SkipLabelNameValidation)+",\n") 842 s = append(s, "}") 843 return strings.Join(s, "") 844 } 845 func (this *WriteResponse) GoString() string { 846 if this == nil { 847 return "nil" 848 } 849 s := make([]string, 0, 4) 850 s = append(s, "&cortexpb.WriteResponse{") 851 s = append(s, "}") 852 return strings.Join(s, "") 853 } 854 func (this *TimeSeries) GoString() string { 855 if this == nil { 856 return "nil" 857 } 858 s := make([]string, 0, 7) 859 s = append(s, "&cortexpb.TimeSeries{") 860 s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") 861 if this.Samples != nil { 862 vs := make([]*Sample, len(this.Samples)) 863 for i := range vs { 864 vs[i] = &this.Samples[i] 865 } 866 s = append(s, "Samples: "+fmt.Sprintf("%#v", vs)+",\n") 867 } 868 if this.Exemplars != nil { 869 vs := make([]*Exemplar, len(this.Exemplars)) 870 for i := range vs { 871 vs[i] = &this.Exemplars[i] 872 } 873 s = append(s, "Exemplars: "+fmt.Sprintf("%#v", vs)+",\n") 874 } 875 s = append(s, "}") 876 return strings.Join(s, "") 877 } 878 func (this *LabelPair) GoString() string { 879 if this == nil { 880 return "nil" 881 } 882 s := make([]string, 0, 6) 883 s = append(s, "&cortexpb.LabelPair{") 884 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 885 s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") 886 s = append(s, "}") 887 return strings.Join(s, "") 888 } 889 func (this *Sample) GoString() string { 890 if this == nil { 891 return "nil" 892 } 893 s := make([]string, 0, 6) 894 s = append(s, "&cortexpb.Sample{") 895 s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") 896 s = append(s, "TimestampMs: "+fmt.Sprintf("%#v", this.TimestampMs)+",\n") 897 s = append(s, "}") 898 return strings.Join(s, "") 899 } 900 func (this *MetricMetadata) GoString() string { 901 if this == nil { 902 return "nil" 903 } 904 s := make([]string, 0, 8) 905 s = append(s, "&cortexpb.MetricMetadata{") 906 s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") 907 s = append(s, "MetricFamilyName: "+fmt.Sprintf("%#v", this.MetricFamilyName)+",\n") 908 s = append(s, "Help: "+fmt.Sprintf("%#v", this.Help)+",\n") 909 s = append(s, "Unit: "+fmt.Sprintf("%#v", this.Unit)+",\n") 910 s = append(s, "}") 911 return strings.Join(s, "") 912 } 913 func (this *Metric) GoString() string { 914 if this == nil { 915 return "nil" 916 } 917 s := make([]string, 0, 5) 918 s = append(s, "&cortexpb.Metric{") 919 s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") 920 s = append(s, "}") 921 return strings.Join(s, "") 922 } 923 func (this *Exemplar) GoString() string { 924 if this == nil { 925 return "nil" 926 } 927 s := make([]string, 0, 7) 928 s = append(s, "&cortexpb.Exemplar{") 929 s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") 930 s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") 931 s = append(s, "TimestampMs: "+fmt.Sprintf("%#v", this.TimestampMs)+",\n") 932 s = append(s, "}") 933 return strings.Join(s, "") 934 } 935 func valueToGoStringCortex(v interface{}, typ string) string { 936 rv := reflect.ValueOf(v) 937 if rv.IsNil() { 938 return "nil" 939 } 940 pv := reflect.Indirect(rv).Interface() 941 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 942 } 943 func (m *WriteRequest) Marshal() (dAtA []byte, err error) { 944 size := m.Size() 945 dAtA = make([]byte, size) 946 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 947 if err != nil { 948 return nil, err 949 } 950 return dAtA[:n], nil 951 } 952 953 func (m *WriteRequest) MarshalTo(dAtA []byte) (int, error) { 954 size := m.Size() 955 return m.MarshalToSizedBuffer(dAtA[:size]) 956 } 957 958 func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 959 i := len(dAtA) 960 _ = i 961 var l int 962 _ = l 963 if m.SkipLabelNameValidation { 964 i-- 965 if m.SkipLabelNameValidation { 966 dAtA[i] = 1 967 } else { 968 dAtA[i] = 0 969 } 970 i-- 971 dAtA[i] = 0x3e 972 i-- 973 dAtA[i] = 0xc0 974 } 975 if len(m.Metadata) > 0 { 976 for iNdEx := len(m.Metadata) - 1; iNdEx >= 0; iNdEx-- { 977 { 978 size, err := m.Metadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 979 if err != nil { 980 return 0, err 981 } 982 i -= size 983 i = encodeVarintCortex(dAtA, i, uint64(size)) 984 } 985 i-- 986 dAtA[i] = 0x1a 987 } 988 } 989 if m.Source != 0 { 990 i = encodeVarintCortex(dAtA, i, uint64(m.Source)) 991 i-- 992 dAtA[i] = 0x10 993 } 994 if len(m.Timeseries) > 0 { 995 for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { 996 { 997 size := m.Timeseries[iNdEx].Size() 998 i -= size 999 if _, err := m.Timeseries[iNdEx].MarshalTo(dAtA[i:]); err != nil { 1000 return 0, err 1001 } 1002 i = encodeVarintCortex(dAtA, i, uint64(size)) 1003 } 1004 i-- 1005 dAtA[i] = 0xa 1006 } 1007 } 1008 return len(dAtA) - i, nil 1009 } 1010 1011 func (m *WriteResponse) Marshal() (dAtA []byte, err error) { 1012 size := m.Size() 1013 dAtA = make([]byte, size) 1014 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1015 if err != nil { 1016 return nil, err 1017 } 1018 return dAtA[:n], nil 1019 } 1020 1021 func (m *WriteResponse) MarshalTo(dAtA []byte) (int, error) { 1022 size := m.Size() 1023 return m.MarshalToSizedBuffer(dAtA[:size]) 1024 } 1025 1026 func (m *WriteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1027 i := len(dAtA) 1028 _ = i 1029 var l int 1030 _ = l 1031 return len(dAtA) - i, nil 1032 } 1033 1034 func (m *TimeSeries) Marshal() (dAtA []byte, err error) { 1035 size := m.Size() 1036 dAtA = make([]byte, size) 1037 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1038 if err != nil { 1039 return nil, err 1040 } 1041 return dAtA[:n], nil 1042 } 1043 1044 func (m *TimeSeries) MarshalTo(dAtA []byte) (int, error) { 1045 size := m.Size() 1046 return m.MarshalToSizedBuffer(dAtA[:size]) 1047 } 1048 1049 func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1050 i := len(dAtA) 1051 _ = i 1052 var l int 1053 _ = l 1054 if len(m.Exemplars) > 0 { 1055 for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { 1056 { 1057 size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1058 if err != nil { 1059 return 0, err 1060 } 1061 i -= size 1062 i = encodeVarintCortex(dAtA, i, uint64(size)) 1063 } 1064 i-- 1065 dAtA[i] = 0x1a 1066 } 1067 } 1068 if len(m.Samples) > 0 { 1069 for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { 1070 { 1071 size, err := m.Samples[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 1072 if err != nil { 1073 return 0, err 1074 } 1075 i -= size 1076 i = encodeVarintCortex(dAtA, i, uint64(size)) 1077 } 1078 i-- 1079 dAtA[i] = 0x12 1080 } 1081 } 1082 if len(m.Labels) > 0 { 1083 for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { 1084 { 1085 size := m.Labels[iNdEx].Size() 1086 i -= size 1087 if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { 1088 return 0, err 1089 } 1090 i = encodeVarintCortex(dAtA, i, uint64(size)) 1091 } 1092 i-- 1093 dAtA[i] = 0xa 1094 } 1095 } 1096 return len(dAtA) - i, nil 1097 } 1098 1099 func (m *LabelPair) Marshal() (dAtA []byte, err error) { 1100 size := m.Size() 1101 dAtA = make([]byte, size) 1102 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1103 if err != nil { 1104 return nil, err 1105 } 1106 return dAtA[:n], nil 1107 } 1108 1109 func (m *LabelPair) MarshalTo(dAtA []byte) (int, error) { 1110 size := m.Size() 1111 return m.MarshalToSizedBuffer(dAtA[:size]) 1112 } 1113 1114 func (m *LabelPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1115 i := len(dAtA) 1116 _ = i 1117 var l int 1118 _ = l 1119 if len(m.Value) > 0 { 1120 i -= len(m.Value) 1121 copy(dAtA[i:], m.Value) 1122 i = encodeVarintCortex(dAtA, i, uint64(len(m.Value))) 1123 i-- 1124 dAtA[i] = 0x12 1125 } 1126 if len(m.Name) > 0 { 1127 i -= len(m.Name) 1128 copy(dAtA[i:], m.Name) 1129 i = encodeVarintCortex(dAtA, i, uint64(len(m.Name))) 1130 i-- 1131 dAtA[i] = 0xa 1132 } 1133 return len(dAtA) - i, nil 1134 } 1135 1136 func (m *Sample) Marshal() (dAtA []byte, err error) { 1137 size := m.Size() 1138 dAtA = make([]byte, size) 1139 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1140 if err != nil { 1141 return nil, err 1142 } 1143 return dAtA[:n], nil 1144 } 1145 1146 func (m *Sample) MarshalTo(dAtA []byte) (int, error) { 1147 size := m.Size() 1148 return m.MarshalToSizedBuffer(dAtA[:size]) 1149 } 1150 1151 func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1152 i := len(dAtA) 1153 _ = i 1154 var l int 1155 _ = l 1156 if m.TimestampMs != 0 { 1157 i = encodeVarintCortex(dAtA, i, uint64(m.TimestampMs)) 1158 i-- 1159 dAtA[i] = 0x10 1160 } 1161 if m.Value != 0 { 1162 i -= 8 1163 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) 1164 i-- 1165 dAtA[i] = 0x9 1166 } 1167 return len(dAtA) - i, nil 1168 } 1169 1170 func (m *MetricMetadata) Marshal() (dAtA []byte, err error) { 1171 size := m.Size() 1172 dAtA = make([]byte, size) 1173 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1174 if err != nil { 1175 return nil, err 1176 } 1177 return dAtA[:n], nil 1178 } 1179 1180 func (m *MetricMetadata) MarshalTo(dAtA []byte) (int, error) { 1181 size := m.Size() 1182 return m.MarshalToSizedBuffer(dAtA[:size]) 1183 } 1184 1185 func (m *MetricMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1186 i := len(dAtA) 1187 _ = i 1188 var l int 1189 _ = l 1190 if len(m.Unit) > 0 { 1191 i -= len(m.Unit) 1192 copy(dAtA[i:], m.Unit) 1193 i = encodeVarintCortex(dAtA, i, uint64(len(m.Unit))) 1194 i-- 1195 dAtA[i] = 0x2a 1196 } 1197 if len(m.Help) > 0 { 1198 i -= len(m.Help) 1199 copy(dAtA[i:], m.Help) 1200 i = encodeVarintCortex(dAtA, i, uint64(len(m.Help))) 1201 i-- 1202 dAtA[i] = 0x22 1203 } 1204 if len(m.MetricFamilyName) > 0 { 1205 i -= len(m.MetricFamilyName) 1206 copy(dAtA[i:], m.MetricFamilyName) 1207 i = encodeVarintCortex(dAtA, i, uint64(len(m.MetricFamilyName))) 1208 i-- 1209 dAtA[i] = 0x12 1210 } 1211 if m.Type != 0 { 1212 i = encodeVarintCortex(dAtA, i, uint64(m.Type)) 1213 i-- 1214 dAtA[i] = 0x8 1215 } 1216 return len(dAtA) - i, nil 1217 } 1218 1219 func (m *Metric) Marshal() (dAtA []byte, err error) { 1220 size := m.Size() 1221 dAtA = make([]byte, size) 1222 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1223 if err != nil { 1224 return nil, err 1225 } 1226 return dAtA[:n], nil 1227 } 1228 1229 func (m *Metric) MarshalTo(dAtA []byte) (int, error) { 1230 size := m.Size() 1231 return m.MarshalToSizedBuffer(dAtA[:size]) 1232 } 1233 1234 func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1235 i := len(dAtA) 1236 _ = i 1237 var l int 1238 _ = l 1239 if len(m.Labels) > 0 { 1240 for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { 1241 { 1242 size := m.Labels[iNdEx].Size() 1243 i -= size 1244 if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { 1245 return 0, err 1246 } 1247 i = encodeVarintCortex(dAtA, i, uint64(size)) 1248 } 1249 i-- 1250 dAtA[i] = 0xa 1251 } 1252 } 1253 return len(dAtA) - i, nil 1254 } 1255 1256 func (m *Exemplar) Marshal() (dAtA []byte, err error) { 1257 size := m.Size() 1258 dAtA = make([]byte, size) 1259 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1260 if err != nil { 1261 return nil, err 1262 } 1263 return dAtA[:n], nil 1264 } 1265 1266 func (m *Exemplar) MarshalTo(dAtA []byte) (int, error) { 1267 size := m.Size() 1268 return m.MarshalToSizedBuffer(dAtA[:size]) 1269 } 1270 1271 func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1272 i := len(dAtA) 1273 _ = i 1274 var l int 1275 _ = l 1276 if m.TimestampMs != 0 { 1277 i = encodeVarintCortex(dAtA, i, uint64(m.TimestampMs)) 1278 i-- 1279 dAtA[i] = 0x18 1280 } 1281 if m.Value != 0 { 1282 i -= 8 1283 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) 1284 i-- 1285 dAtA[i] = 0x11 1286 } 1287 if len(m.Labels) > 0 { 1288 for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { 1289 { 1290 size := m.Labels[iNdEx].Size() 1291 i -= size 1292 if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { 1293 return 0, err 1294 } 1295 i = encodeVarintCortex(dAtA, i, uint64(size)) 1296 } 1297 i-- 1298 dAtA[i] = 0xa 1299 } 1300 } 1301 return len(dAtA) - i, nil 1302 } 1303 1304 func encodeVarintCortex(dAtA []byte, offset int, v uint64) int { 1305 offset -= sovCortex(v) 1306 base := offset 1307 for v >= 1<<7 { 1308 dAtA[offset] = uint8(v&0x7f | 0x80) 1309 v >>= 7 1310 offset++ 1311 } 1312 dAtA[offset] = uint8(v) 1313 return base 1314 } 1315 func (m *WriteRequest) Size() (n int) { 1316 if m == nil { 1317 return 0 1318 } 1319 var l int 1320 _ = l 1321 if len(m.Timeseries) > 0 { 1322 for _, e := range m.Timeseries { 1323 l = e.Size() 1324 n += 1 + l + sovCortex(uint64(l)) 1325 } 1326 } 1327 if m.Source != 0 { 1328 n += 1 + sovCortex(uint64(m.Source)) 1329 } 1330 if len(m.Metadata) > 0 { 1331 for _, e := range m.Metadata { 1332 l = e.Size() 1333 n += 1 + l + sovCortex(uint64(l)) 1334 } 1335 } 1336 if m.SkipLabelNameValidation { 1337 n += 3 1338 } 1339 return n 1340 } 1341 1342 func (m *WriteResponse) Size() (n int) { 1343 if m == nil { 1344 return 0 1345 } 1346 var l int 1347 _ = l 1348 return n 1349 } 1350 1351 func (m *TimeSeries) Size() (n int) { 1352 if m == nil { 1353 return 0 1354 } 1355 var l int 1356 _ = l 1357 if len(m.Labels) > 0 { 1358 for _, e := range m.Labels { 1359 l = e.Size() 1360 n += 1 + l + sovCortex(uint64(l)) 1361 } 1362 } 1363 if len(m.Samples) > 0 { 1364 for _, e := range m.Samples { 1365 l = e.Size() 1366 n += 1 + l + sovCortex(uint64(l)) 1367 } 1368 } 1369 if len(m.Exemplars) > 0 { 1370 for _, e := range m.Exemplars { 1371 l = e.Size() 1372 n += 1 + l + sovCortex(uint64(l)) 1373 } 1374 } 1375 return n 1376 } 1377 1378 func (m *LabelPair) Size() (n int) { 1379 if m == nil { 1380 return 0 1381 } 1382 var l int 1383 _ = l 1384 l = len(m.Name) 1385 if l > 0 { 1386 n += 1 + l + sovCortex(uint64(l)) 1387 } 1388 l = len(m.Value) 1389 if l > 0 { 1390 n += 1 + l + sovCortex(uint64(l)) 1391 } 1392 return n 1393 } 1394 1395 func (m *Sample) Size() (n int) { 1396 if m == nil { 1397 return 0 1398 } 1399 var l int 1400 _ = l 1401 if m.Value != 0 { 1402 n += 9 1403 } 1404 if m.TimestampMs != 0 { 1405 n += 1 + sovCortex(uint64(m.TimestampMs)) 1406 } 1407 return n 1408 } 1409 1410 func (m *MetricMetadata) Size() (n int) { 1411 if m == nil { 1412 return 0 1413 } 1414 var l int 1415 _ = l 1416 if m.Type != 0 { 1417 n += 1 + sovCortex(uint64(m.Type)) 1418 } 1419 l = len(m.MetricFamilyName) 1420 if l > 0 { 1421 n += 1 + l + sovCortex(uint64(l)) 1422 } 1423 l = len(m.Help) 1424 if l > 0 { 1425 n += 1 + l + sovCortex(uint64(l)) 1426 } 1427 l = len(m.Unit) 1428 if l > 0 { 1429 n += 1 + l + sovCortex(uint64(l)) 1430 } 1431 return n 1432 } 1433 1434 func (m *Metric) Size() (n int) { 1435 if m == nil { 1436 return 0 1437 } 1438 var l int 1439 _ = l 1440 if len(m.Labels) > 0 { 1441 for _, e := range m.Labels { 1442 l = e.Size() 1443 n += 1 + l + sovCortex(uint64(l)) 1444 } 1445 } 1446 return n 1447 } 1448 1449 func (m *Exemplar) Size() (n int) { 1450 if m == nil { 1451 return 0 1452 } 1453 var l int 1454 _ = l 1455 if len(m.Labels) > 0 { 1456 for _, e := range m.Labels { 1457 l = e.Size() 1458 n += 1 + l + sovCortex(uint64(l)) 1459 } 1460 } 1461 if m.Value != 0 { 1462 n += 9 1463 } 1464 if m.TimestampMs != 0 { 1465 n += 1 + sovCortex(uint64(m.TimestampMs)) 1466 } 1467 return n 1468 } 1469 1470 func sovCortex(x uint64) (n int) { 1471 return (math_bits.Len64(x|1) + 6) / 7 1472 } 1473 func sozCortex(x uint64) (n int) { 1474 return sovCortex(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1475 } 1476 func (this *WriteRequest) String() string { 1477 if this == nil { 1478 return "nil" 1479 } 1480 repeatedStringForMetadata := "[]*MetricMetadata{" 1481 for _, f := range this.Metadata { 1482 repeatedStringForMetadata += strings.Replace(f.String(), "MetricMetadata", "MetricMetadata", 1) + "," 1483 } 1484 repeatedStringForMetadata += "}" 1485 s := strings.Join([]string{`&WriteRequest{`, 1486 `Timeseries:` + fmt.Sprintf("%v", this.Timeseries) + `,`, 1487 `Source:` + fmt.Sprintf("%v", this.Source) + `,`, 1488 `Metadata:` + repeatedStringForMetadata + `,`, 1489 `SkipLabelNameValidation:` + fmt.Sprintf("%v", this.SkipLabelNameValidation) + `,`, 1490 `}`, 1491 }, "") 1492 return s 1493 } 1494 func (this *WriteResponse) String() string { 1495 if this == nil { 1496 return "nil" 1497 } 1498 s := strings.Join([]string{`&WriteResponse{`, 1499 `}`, 1500 }, "") 1501 return s 1502 } 1503 func (this *TimeSeries) String() string { 1504 if this == nil { 1505 return "nil" 1506 } 1507 repeatedStringForSamples := "[]Sample{" 1508 for _, f := range this.Samples { 1509 repeatedStringForSamples += strings.Replace(strings.Replace(f.String(), "Sample", "Sample", 1), `&`, ``, 1) + "," 1510 } 1511 repeatedStringForSamples += "}" 1512 repeatedStringForExemplars := "[]Exemplar{" 1513 for _, f := range this.Exemplars { 1514 repeatedStringForExemplars += strings.Replace(strings.Replace(f.String(), "Exemplar", "Exemplar", 1), `&`, ``, 1) + "," 1515 } 1516 repeatedStringForExemplars += "}" 1517 s := strings.Join([]string{`&TimeSeries{`, 1518 `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, 1519 `Samples:` + repeatedStringForSamples + `,`, 1520 `Exemplars:` + repeatedStringForExemplars + `,`, 1521 `}`, 1522 }, "") 1523 return s 1524 } 1525 func (this *LabelPair) String() string { 1526 if this == nil { 1527 return "nil" 1528 } 1529 s := strings.Join([]string{`&LabelPair{`, 1530 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 1531 `Value:` + fmt.Sprintf("%v", this.Value) + `,`, 1532 `}`, 1533 }, "") 1534 return s 1535 } 1536 func (this *Sample) String() string { 1537 if this == nil { 1538 return "nil" 1539 } 1540 s := strings.Join([]string{`&Sample{`, 1541 `Value:` + fmt.Sprintf("%v", this.Value) + `,`, 1542 `TimestampMs:` + fmt.Sprintf("%v", this.TimestampMs) + `,`, 1543 `}`, 1544 }, "") 1545 return s 1546 } 1547 func (this *MetricMetadata) String() string { 1548 if this == nil { 1549 return "nil" 1550 } 1551 s := strings.Join([]string{`&MetricMetadata{`, 1552 `Type:` + fmt.Sprintf("%v", this.Type) + `,`, 1553 `MetricFamilyName:` + fmt.Sprintf("%v", this.MetricFamilyName) + `,`, 1554 `Help:` + fmt.Sprintf("%v", this.Help) + `,`, 1555 `Unit:` + fmt.Sprintf("%v", this.Unit) + `,`, 1556 `}`, 1557 }, "") 1558 return s 1559 } 1560 func (this *Metric) String() string { 1561 if this == nil { 1562 return "nil" 1563 } 1564 s := strings.Join([]string{`&Metric{`, 1565 `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, 1566 `}`, 1567 }, "") 1568 return s 1569 } 1570 func (this *Exemplar) String() string { 1571 if this == nil { 1572 return "nil" 1573 } 1574 s := strings.Join([]string{`&Exemplar{`, 1575 `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, 1576 `Value:` + fmt.Sprintf("%v", this.Value) + `,`, 1577 `TimestampMs:` + fmt.Sprintf("%v", this.TimestampMs) + `,`, 1578 `}`, 1579 }, "") 1580 return s 1581 } 1582 func valueToStringCortex(v interface{}) string { 1583 rv := reflect.ValueOf(v) 1584 if rv.IsNil() { 1585 return "nil" 1586 } 1587 pv := reflect.Indirect(rv).Interface() 1588 return fmt.Sprintf("*%v", pv) 1589 } 1590 func (m *WriteRequest) Unmarshal(dAtA []byte) error { 1591 l := len(dAtA) 1592 iNdEx := 0 1593 for iNdEx < l { 1594 preIndex := iNdEx 1595 var wire uint64 1596 for shift := uint(0); ; shift += 7 { 1597 if shift >= 64 { 1598 return ErrIntOverflowCortex 1599 } 1600 if iNdEx >= l { 1601 return io.ErrUnexpectedEOF 1602 } 1603 b := dAtA[iNdEx] 1604 iNdEx++ 1605 wire |= uint64(b&0x7F) << shift 1606 if b < 0x80 { 1607 break 1608 } 1609 } 1610 fieldNum := int32(wire >> 3) 1611 wireType := int(wire & 0x7) 1612 if wireType == 4 { 1613 return fmt.Errorf("proto: WriteRequest: wiretype end group for non-group") 1614 } 1615 if fieldNum <= 0 { 1616 return fmt.Errorf("proto: WriteRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1617 } 1618 switch fieldNum { 1619 case 1: 1620 if wireType != 2 { 1621 return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) 1622 } 1623 var msglen int 1624 for shift := uint(0); ; shift += 7 { 1625 if shift >= 64 { 1626 return ErrIntOverflowCortex 1627 } 1628 if iNdEx >= l { 1629 return io.ErrUnexpectedEOF 1630 } 1631 b := dAtA[iNdEx] 1632 iNdEx++ 1633 msglen |= int(b&0x7F) << shift 1634 if b < 0x80 { 1635 break 1636 } 1637 } 1638 if msglen < 0 { 1639 return ErrInvalidLengthCortex 1640 } 1641 postIndex := iNdEx + msglen 1642 if postIndex < 0 { 1643 return ErrInvalidLengthCortex 1644 } 1645 if postIndex > l { 1646 return io.ErrUnexpectedEOF 1647 } 1648 m.Timeseries = append(m.Timeseries, PreallocTimeseries{}) 1649 if err := m.Timeseries[len(m.Timeseries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1650 return err 1651 } 1652 iNdEx = postIndex 1653 case 2: 1654 if wireType != 0 { 1655 return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) 1656 } 1657 m.Source = 0 1658 for shift := uint(0); ; shift += 7 { 1659 if shift >= 64 { 1660 return ErrIntOverflowCortex 1661 } 1662 if iNdEx >= l { 1663 return io.ErrUnexpectedEOF 1664 } 1665 b := dAtA[iNdEx] 1666 iNdEx++ 1667 m.Source |= WriteRequest_SourceEnum(b&0x7F) << shift 1668 if b < 0x80 { 1669 break 1670 } 1671 } 1672 case 3: 1673 if wireType != 2 { 1674 return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) 1675 } 1676 var msglen int 1677 for shift := uint(0); ; shift += 7 { 1678 if shift >= 64 { 1679 return ErrIntOverflowCortex 1680 } 1681 if iNdEx >= l { 1682 return io.ErrUnexpectedEOF 1683 } 1684 b := dAtA[iNdEx] 1685 iNdEx++ 1686 msglen |= int(b&0x7F) << shift 1687 if b < 0x80 { 1688 break 1689 } 1690 } 1691 if msglen < 0 { 1692 return ErrInvalidLengthCortex 1693 } 1694 postIndex := iNdEx + msglen 1695 if postIndex < 0 { 1696 return ErrInvalidLengthCortex 1697 } 1698 if postIndex > l { 1699 return io.ErrUnexpectedEOF 1700 } 1701 m.Metadata = append(m.Metadata, &MetricMetadata{}) 1702 if err := m.Metadata[len(m.Metadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1703 return err 1704 } 1705 iNdEx = postIndex 1706 case 1000: 1707 if wireType != 0 { 1708 return fmt.Errorf("proto: wrong wireType = %d for field SkipLabelNameValidation", wireType) 1709 } 1710 var v int 1711 for shift := uint(0); ; shift += 7 { 1712 if shift >= 64 { 1713 return ErrIntOverflowCortex 1714 } 1715 if iNdEx >= l { 1716 return io.ErrUnexpectedEOF 1717 } 1718 b := dAtA[iNdEx] 1719 iNdEx++ 1720 v |= int(b&0x7F) << shift 1721 if b < 0x80 { 1722 break 1723 } 1724 } 1725 m.SkipLabelNameValidation = bool(v != 0) 1726 default: 1727 iNdEx = preIndex 1728 skippy, err := skipCortex(dAtA[iNdEx:]) 1729 if err != nil { 1730 return err 1731 } 1732 if skippy < 0 { 1733 return ErrInvalidLengthCortex 1734 } 1735 if (iNdEx + skippy) < 0 { 1736 return ErrInvalidLengthCortex 1737 } 1738 if (iNdEx + skippy) > l { 1739 return io.ErrUnexpectedEOF 1740 } 1741 iNdEx += skippy 1742 } 1743 } 1744 1745 if iNdEx > l { 1746 return io.ErrUnexpectedEOF 1747 } 1748 return nil 1749 } 1750 func (m *WriteResponse) Unmarshal(dAtA []byte) error { 1751 l := len(dAtA) 1752 iNdEx := 0 1753 for iNdEx < l { 1754 preIndex := iNdEx 1755 var wire uint64 1756 for shift := uint(0); ; shift += 7 { 1757 if shift >= 64 { 1758 return ErrIntOverflowCortex 1759 } 1760 if iNdEx >= l { 1761 return io.ErrUnexpectedEOF 1762 } 1763 b := dAtA[iNdEx] 1764 iNdEx++ 1765 wire |= uint64(b&0x7F) << shift 1766 if b < 0x80 { 1767 break 1768 } 1769 } 1770 fieldNum := int32(wire >> 3) 1771 wireType := int(wire & 0x7) 1772 if wireType == 4 { 1773 return fmt.Errorf("proto: WriteResponse: wiretype end group for non-group") 1774 } 1775 if fieldNum <= 0 { 1776 return fmt.Errorf("proto: WriteResponse: illegal tag %d (wire type %d)", fieldNum, wire) 1777 } 1778 switch fieldNum { 1779 default: 1780 iNdEx = preIndex 1781 skippy, err := skipCortex(dAtA[iNdEx:]) 1782 if err != nil { 1783 return err 1784 } 1785 if skippy < 0 { 1786 return ErrInvalidLengthCortex 1787 } 1788 if (iNdEx + skippy) < 0 { 1789 return ErrInvalidLengthCortex 1790 } 1791 if (iNdEx + skippy) > l { 1792 return io.ErrUnexpectedEOF 1793 } 1794 iNdEx += skippy 1795 } 1796 } 1797 1798 if iNdEx > l { 1799 return io.ErrUnexpectedEOF 1800 } 1801 return nil 1802 } 1803 func (m *TimeSeries) Unmarshal(dAtA []byte) error { 1804 l := len(dAtA) 1805 iNdEx := 0 1806 for iNdEx < l { 1807 preIndex := iNdEx 1808 var wire uint64 1809 for shift := uint(0); ; shift += 7 { 1810 if shift >= 64 { 1811 return ErrIntOverflowCortex 1812 } 1813 if iNdEx >= l { 1814 return io.ErrUnexpectedEOF 1815 } 1816 b := dAtA[iNdEx] 1817 iNdEx++ 1818 wire |= uint64(b&0x7F) << shift 1819 if b < 0x80 { 1820 break 1821 } 1822 } 1823 fieldNum := int32(wire >> 3) 1824 wireType := int(wire & 0x7) 1825 if wireType == 4 { 1826 return fmt.Errorf("proto: TimeSeries: wiretype end group for non-group") 1827 } 1828 if fieldNum <= 0 { 1829 return fmt.Errorf("proto: TimeSeries: illegal tag %d (wire type %d)", fieldNum, wire) 1830 } 1831 switch fieldNum { 1832 case 1: 1833 if wireType != 2 { 1834 return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) 1835 } 1836 var msglen int 1837 for shift := uint(0); ; shift += 7 { 1838 if shift >= 64 { 1839 return ErrIntOverflowCortex 1840 } 1841 if iNdEx >= l { 1842 return io.ErrUnexpectedEOF 1843 } 1844 b := dAtA[iNdEx] 1845 iNdEx++ 1846 msglen |= int(b&0x7F) << shift 1847 if b < 0x80 { 1848 break 1849 } 1850 } 1851 if msglen < 0 { 1852 return ErrInvalidLengthCortex 1853 } 1854 postIndex := iNdEx + msglen 1855 if postIndex < 0 { 1856 return ErrInvalidLengthCortex 1857 } 1858 if postIndex > l { 1859 return io.ErrUnexpectedEOF 1860 } 1861 m.Labels = append(m.Labels, LabelAdapter{}) 1862 if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1863 return err 1864 } 1865 iNdEx = postIndex 1866 case 2: 1867 if wireType != 2 { 1868 return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) 1869 } 1870 var msglen int 1871 for shift := uint(0); ; shift += 7 { 1872 if shift >= 64 { 1873 return ErrIntOverflowCortex 1874 } 1875 if iNdEx >= l { 1876 return io.ErrUnexpectedEOF 1877 } 1878 b := dAtA[iNdEx] 1879 iNdEx++ 1880 msglen |= int(b&0x7F) << shift 1881 if b < 0x80 { 1882 break 1883 } 1884 } 1885 if msglen < 0 { 1886 return ErrInvalidLengthCortex 1887 } 1888 postIndex := iNdEx + msglen 1889 if postIndex < 0 { 1890 return ErrInvalidLengthCortex 1891 } 1892 if postIndex > l { 1893 return io.ErrUnexpectedEOF 1894 } 1895 m.Samples = append(m.Samples, Sample{}) 1896 if err := m.Samples[len(m.Samples)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1897 return err 1898 } 1899 iNdEx = postIndex 1900 case 3: 1901 if wireType != 2 { 1902 return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) 1903 } 1904 var msglen int 1905 for shift := uint(0); ; shift += 7 { 1906 if shift >= 64 { 1907 return ErrIntOverflowCortex 1908 } 1909 if iNdEx >= l { 1910 return io.ErrUnexpectedEOF 1911 } 1912 b := dAtA[iNdEx] 1913 iNdEx++ 1914 msglen |= int(b&0x7F) << shift 1915 if b < 0x80 { 1916 break 1917 } 1918 } 1919 if msglen < 0 { 1920 return ErrInvalidLengthCortex 1921 } 1922 postIndex := iNdEx + msglen 1923 if postIndex < 0 { 1924 return ErrInvalidLengthCortex 1925 } 1926 if postIndex > l { 1927 return io.ErrUnexpectedEOF 1928 } 1929 m.Exemplars = append(m.Exemplars, Exemplar{}) 1930 if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1931 return err 1932 } 1933 iNdEx = postIndex 1934 default: 1935 iNdEx = preIndex 1936 skippy, err := skipCortex(dAtA[iNdEx:]) 1937 if err != nil { 1938 return err 1939 } 1940 if skippy < 0 { 1941 return ErrInvalidLengthCortex 1942 } 1943 if (iNdEx + skippy) < 0 { 1944 return ErrInvalidLengthCortex 1945 } 1946 if (iNdEx + skippy) > l { 1947 return io.ErrUnexpectedEOF 1948 } 1949 iNdEx += skippy 1950 } 1951 } 1952 1953 if iNdEx > l { 1954 return io.ErrUnexpectedEOF 1955 } 1956 return nil 1957 } 1958 func (m *LabelPair) Unmarshal(dAtA []byte) error { 1959 l := len(dAtA) 1960 iNdEx := 0 1961 for iNdEx < l { 1962 preIndex := iNdEx 1963 var wire uint64 1964 for shift := uint(0); ; shift += 7 { 1965 if shift >= 64 { 1966 return ErrIntOverflowCortex 1967 } 1968 if iNdEx >= l { 1969 return io.ErrUnexpectedEOF 1970 } 1971 b := dAtA[iNdEx] 1972 iNdEx++ 1973 wire |= uint64(b&0x7F) << shift 1974 if b < 0x80 { 1975 break 1976 } 1977 } 1978 fieldNum := int32(wire >> 3) 1979 wireType := int(wire & 0x7) 1980 if wireType == 4 { 1981 return fmt.Errorf("proto: LabelPair: wiretype end group for non-group") 1982 } 1983 if fieldNum <= 0 { 1984 return fmt.Errorf("proto: LabelPair: illegal tag %d (wire type %d)", fieldNum, wire) 1985 } 1986 switch fieldNum { 1987 case 1: 1988 if wireType != 2 { 1989 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 1990 } 1991 var byteLen int 1992 for shift := uint(0); ; shift += 7 { 1993 if shift >= 64 { 1994 return ErrIntOverflowCortex 1995 } 1996 if iNdEx >= l { 1997 return io.ErrUnexpectedEOF 1998 } 1999 b := dAtA[iNdEx] 2000 iNdEx++ 2001 byteLen |= int(b&0x7F) << shift 2002 if b < 0x80 { 2003 break 2004 } 2005 } 2006 if byteLen < 0 { 2007 return ErrInvalidLengthCortex 2008 } 2009 postIndex := iNdEx + byteLen 2010 if postIndex < 0 { 2011 return ErrInvalidLengthCortex 2012 } 2013 if postIndex > l { 2014 return io.ErrUnexpectedEOF 2015 } 2016 m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) 2017 if m.Name == nil { 2018 m.Name = []byte{} 2019 } 2020 iNdEx = postIndex 2021 case 2: 2022 if wireType != 2 { 2023 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 2024 } 2025 var byteLen int 2026 for shift := uint(0); ; shift += 7 { 2027 if shift >= 64 { 2028 return ErrIntOverflowCortex 2029 } 2030 if iNdEx >= l { 2031 return io.ErrUnexpectedEOF 2032 } 2033 b := dAtA[iNdEx] 2034 iNdEx++ 2035 byteLen |= int(b&0x7F) << shift 2036 if b < 0x80 { 2037 break 2038 } 2039 } 2040 if byteLen < 0 { 2041 return ErrInvalidLengthCortex 2042 } 2043 postIndex := iNdEx + byteLen 2044 if postIndex < 0 { 2045 return ErrInvalidLengthCortex 2046 } 2047 if postIndex > l { 2048 return io.ErrUnexpectedEOF 2049 } 2050 m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) 2051 if m.Value == nil { 2052 m.Value = []byte{} 2053 } 2054 iNdEx = postIndex 2055 default: 2056 iNdEx = preIndex 2057 skippy, err := skipCortex(dAtA[iNdEx:]) 2058 if err != nil { 2059 return err 2060 } 2061 if skippy < 0 { 2062 return ErrInvalidLengthCortex 2063 } 2064 if (iNdEx + skippy) < 0 { 2065 return ErrInvalidLengthCortex 2066 } 2067 if (iNdEx + skippy) > l { 2068 return io.ErrUnexpectedEOF 2069 } 2070 iNdEx += skippy 2071 } 2072 } 2073 2074 if iNdEx > l { 2075 return io.ErrUnexpectedEOF 2076 } 2077 return nil 2078 } 2079 func (m *Sample) Unmarshal(dAtA []byte) error { 2080 l := len(dAtA) 2081 iNdEx := 0 2082 for iNdEx < l { 2083 preIndex := iNdEx 2084 var wire uint64 2085 for shift := uint(0); ; shift += 7 { 2086 if shift >= 64 { 2087 return ErrIntOverflowCortex 2088 } 2089 if iNdEx >= l { 2090 return io.ErrUnexpectedEOF 2091 } 2092 b := dAtA[iNdEx] 2093 iNdEx++ 2094 wire |= uint64(b&0x7F) << shift 2095 if b < 0x80 { 2096 break 2097 } 2098 } 2099 fieldNum := int32(wire >> 3) 2100 wireType := int(wire & 0x7) 2101 if wireType == 4 { 2102 return fmt.Errorf("proto: Sample: wiretype end group for non-group") 2103 } 2104 if fieldNum <= 0 { 2105 return fmt.Errorf("proto: Sample: illegal tag %d (wire type %d)", fieldNum, wire) 2106 } 2107 switch fieldNum { 2108 case 1: 2109 if wireType != 1 { 2110 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 2111 } 2112 var v uint64 2113 if (iNdEx + 8) > l { 2114 return io.ErrUnexpectedEOF 2115 } 2116 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 2117 iNdEx += 8 2118 m.Value = float64(math.Float64frombits(v)) 2119 case 2: 2120 if wireType != 0 { 2121 return fmt.Errorf("proto: wrong wireType = %d for field TimestampMs", wireType) 2122 } 2123 m.TimestampMs = 0 2124 for shift := uint(0); ; shift += 7 { 2125 if shift >= 64 { 2126 return ErrIntOverflowCortex 2127 } 2128 if iNdEx >= l { 2129 return io.ErrUnexpectedEOF 2130 } 2131 b := dAtA[iNdEx] 2132 iNdEx++ 2133 m.TimestampMs |= int64(b&0x7F) << shift 2134 if b < 0x80 { 2135 break 2136 } 2137 } 2138 default: 2139 iNdEx = preIndex 2140 skippy, err := skipCortex(dAtA[iNdEx:]) 2141 if err != nil { 2142 return err 2143 } 2144 if skippy < 0 { 2145 return ErrInvalidLengthCortex 2146 } 2147 if (iNdEx + skippy) < 0 { 2148 return ErrInvalidLengthCortex 2149 } 2150 if (iNdEx + skippy) > l { 2151 return io.ErrUnexpectedEOF 2152 } 2153 iNdEx += skippy 2154 } 2155 } 2156 2157 if iNdEx > l { 2158 return io.ErrUnexpectedEOF 2159 } 2160 return nil 2161 } 2162 func (m *MetricMetadata) Unmarshal(dAtA []byte) error { 2163 l := len(dAtA) 2164 iNdEx := 0 2165 for iNdEx < l { 2166 preIndex := iNdEx 2167 var wire uint64 2168 for shift := uint(0); ; shift += 7 { 2169 if shift >= 64 { 2170 return ErrIntOverflowCortex 2171 } 2172 if iNdEx >= l { 2173 return io.ErrUnexpectedEOF 2174 } 2175 b := dAtA[iNdEx] 2176 iNdEx++ 2177 wire |= uint64(b&0x7F) << shift 2178 if b < 0x80 { 2179 break 2180 } 2181 } 2182 fieldNum := int32(wire >> 3) 2183 wireType := int(wire & 0x7) 2184 if wireType == 4 { 2185 return fmt.Errorf("proto: MetricMetadata: wiretype end group for non-group") 2186 } 2187 if fieldNum <= 0 { 2188 return fmt.Errorf("proto: MetricMetadata: illegal tag %d (wire type %d)", fieldNum, wire) 2189 } 2190 switch fieldNum { 2191 case 1: 2192 if wireType != 0 { 2193 return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) 2194 } 2195 m.Type = 0 2196 for shift := uint(0); ; shift += 7 { 2197 if shift >= 64 { 2198 return ErrIntOverflowCortex 2199 } 2200 if iNdEx >= l { 2201 return io.ErrUnexpectedEOF 2202 } 2203 b := dAtA[iNdEx] 2204 iNdEx++ 2205 m.Type |= MetricMetadata_MetricType(b&0x7F) << shift 2206 if b < 0x80 { 2207 break 2208 } 2209 } 2210 case 2: 2211 if wireType != 2 { 2212 return fmt.Errorf("proto: wrong wireType = %d for field MetricFamilyName", wireType) 2213 } 2214 var stringLen uint64 2215 for shift := uint(0); ; shift += 7 { 2216 if shift >= 64 { 2217 return ErrIntOverflowCortex 2218 } 2219 if iNdEx >= l { 2220 return io.ErrUnexpectedEOF 2221 } 2222 b := dAtA[iNdEx] 2223 iNdEx++ 2224 stringLen |= uint64(b&0x7F) << shift 2225 if b < 0x80 { 2226 break 2227 } 2228 } 2229 intStringLen := int(stringLen) 2230 if intStringLen < 0 { 2231 return ErrInvalidLengthCortex 2232 } 2233 postIndex := iNdEx + intStringLen 2234 if postIndex < 0 { 2235 return ErrInvalidLengthCortex 2236 } 2237 if postIndex > l { 2238 return io.ErrUnexpectedEOF 2239 } 2240 m.MetricFamilyName = string(dAtA[iNdEx:postIndex]) 2241 iNdEx = postIndex 2242 case 4: 2243 if wireType != 2 { 2244 return fmt.Errorf("proto: wrong wireType = %d for field Help", wireType) 2245 } 2246 var stringLen uint64 2247 for shift := uint(0); ; shift += 7 { 2248 if shift >= 64 { 2249 return ErrIntOverflowCortex 2250 } 2251 if iNdEx >= l { 2252 return io.ErrUnexpectedEOF 2253 } 2254 b := dAtA[iNdEx] 2255 iNdEx++ 2256 stringLen |= uint64(b&0x7F) << shift 2257 if b < 0x80 { 2258 break 2259 } 2260 } 2261 intStringLen := int(stringLen) 2262 if intStringLen < 0 { 2263 return ErrInvalidLengthCortex 2264 } 2265 postIndex := iNdEx + intStringLen 2266 if postIndex < 0 { 2267 return ErrInvalidLengthCortex 2268 } 2269 if postIndex > l { 2270 return io.ErrUnexpectedEOF 2271 } 2272 m.Help = string(dAtA[iNdEx:postIndex]) 2273 iNdEx = postIndex 2274 case 5: 2275 if wireType != 2 { 2276 return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) 2277 } 2278 var stringLen uint64 2279 for shift := uint(0); ; shift += 7 { 2280 if shift >= 64 { 2281 return ErrIntOverflowCortex 2282 } 2283 if iNdEx >= l { 2284 return io.ErrUnexpectedEOF 2285 } 2286 b := dAtA[iNdEx] 2287 iNdEx++ 2288 stringLen |= uint64(b&0x7F) << shift 2289 if b < 0x80 { 2290 break 2291 } 2292 } 2293 intStringLen := int(stringLen) 2294 if intStringLen < 0 { 2295 return ErrInvalidLengthCortex 2296 } 2297 postIndex := iNdEx + intStringLen 2298 if postIndex < 0 { 2299 return ErrInvalidLengthCortex 2300 } 2301 if postIndex > l { 2302 return io.ErrUnexpectedEOF 2303 } 2304 m.Unit = string(dAtA[iNdEx:postIndex]) 2305 iNdEx = postIndex 2306 default: 2307 iNdEx = preIndex 2308 skippy, err := skipCortex(dAtA[iNdEx:]) 2309 if err != nil { 2310 return err 2311 } 2312 if skippy < 0 { 2313 return ErrInvalidLengthCortex 2314 } 2315 if (iNdEx + skippy) < 0 { 2316 return ErrInvalidLengthCortex 2317 } 2318 if (iNdEx + skippy) > l { 2319 return io.ErrUnexpectedEOF 2320 } 2321 iNdEx += skippy 2322 } 2323 } 2324 2325 if iNdEx > l { 2326 return io.ErrUnexpectedEOF 2327 } 2328 return nil 2329 } 2330 func (m *Metric) Unmarshal(dAtA []byte) error { 2331 l := len(dAtA) 2332 iNdEx := 0 2333 for iNdEx < l { 2334 preIndex := iNdEx 2335 var wire uint64 2336 for shift := uint(0); ; shift += 7 { 2337 if shift >= 64 { 2338 return ErrIntOverflowCortex 2339 } 2340 if iNdEx >= l { 2341 return io.ErrUnexpectedEOF 2342 } 2343 b := dAtA[iNdEx] 2344 iNdEx++ 2345 wire |= uint64(b&0x7F) << shift 2346 if b < 0x80 { 2347 break 2348 } 2349 } 2350 fieldNum := int32(wire >> 3) 2351 wireType := int(wire & 0x7) 2352 if wireType == 4 { 2353 return fmt.Errorf("proto: Metric: wiretype end group for non-group") 2354 } 2355 if fieldNum <= 0 { 2356 return fmt.Errorf("proto: Metric: illegal tag %d (wire type %d)", fieldNum, wire) 2357 } 2358 switch fieldNum { 2359 case 1: 2360 if wireType != 2 { 2361 return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) 2362 } 2363 var msglen int 2364 for shift := uint(0); ; shift += 7 { 2365 if shift >= 64 { 2366 return ErrIntOverflowCortex 2367 } 2368 if iNdEx >= l { 2369 return io.ErrUnexpectedEOF 2370 } 2371 b := dAtA[iNdEx] 2372 iNdEx++ 2373 msglen |= int(b&0x7F) << shift 2374 if b < 0x80 { 2375 break 2376 } 2377 } 2378 if msglen < 0 { 2379 return ErrInvalidLengthCortex 2380 } 2381 postIndex := iNdEx + msglen 2382 if postIndex < 0 { 2383 return ErrInvalidLengthCortex 2384 } 2385 if postIndex > l { 2386 return io.ErrUnexpectedEOF 2387 } 2388 m.Labels = append(m.Labels, LabelAdapter{}) 2389 if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2390 return err 2391 } 2392 iNdEx = postIndex 2393 default: 2394 iNdEx = preIndex 2395 skippy, err := skipCortex(dAtA[iNdEx:]) 2396 if err != nil { 2397 return err 2398 } 2399 if skippy < 0 { 2400 return ErrInvalidLengthCortex 2401 } 2402 if (iNdEx + skippy) < 0 { 2403 return ErrInvalidLengthCortex 2404 } 2405 if (iNdEx + skippy) > l { 2406 return io.ErrUnexpectedEOF 2407 } 2408 iNdEx += skippy 2409 } 2410 } 2411 2412 if iNdEx > l { 2413 return io.ErrUnexpectedEOF 2414 } 2415 return nil 2416 } 2417 func (m *Exemplar) Unmarshal(dAtA []byte) error { 2418 l := len(dAtA) 2419 iNdEx := 0 2420 for iNdEx < l { 2421 preIndex := iNdEx 2422 var wire uint64 2423 for shift := uint(0); ; shift += 7 { 2424 if shift >= 64 { 2425 return ErrIntOverflowCortex 2426 } 2427 if iNdEx >= l { 2428 return io.ErrUnexpectedEOF 2429 } 2430 b := dAtA[iNdEx] 2431 iNdEx++ 2432 wire |= uint64(b&0x7F) << shift 2433 if b < 0x80 { 2434 break 2435 } 2436 } 2437 fieldNum := int32(wire >> 3) 2438 wireType := int(wire & 0x7) 2439 if wireType == 4 { 2440 return fmt.Errorf("proto: Exemplar: wiretype end group for non-group") 2441 } 2442 if fieldNum <= 0 { 2443 return fmt.Errorf("proto: Exemplar: illegal tag %d (wire type %d)", fieldNum, wire) 2444 } 2445 switch fieldNum { 2446 case 1: 2447 if wireType != 2 { 2448 return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) 2449 } 2450 var msglen int 2451 for shift := uint(0); ; shift += 7 { 2452 if shift >= 64 { 2453 return ErrIntOverflowCortex 2454 } 2455 if iNdEx >= l { 2456 return io.ErrUnexpectedEOF 2457 } 2458 b := dAtA[iNdEx] 2459 iNdEx++ 2460 msglen |= int(b&0x7F) << shift 2461 if b < 0x80 { 2462 break 2463 } 2464 } 2465 if msglen < 0 { 2466 return ErrInvalidLengthCortex 2467 } 2468 postIndex := iNdEx + msglen 2469 if postIndex < 0 { 2470 return ErrInvalidLengthCortex 2471 } 2472 if postIndex > l { 2473 return io.ErrUnexpectedEOF 2474 } 2475 m.Labels = append(m.Labels, LabelAdapter{}) 2476 if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2477 return err 2478 } 2479 iNdEx = postIndex 2480 case 2: 2481 if wireType != 1 { 2482 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 2483 } 2484 var v uint64 2485 if (iNdEx + 8) > l { 2486 return io.ErrUnexpectedEOF 2487 } 2488 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 2489 iNdEx += 8 2490 m.Value = float64(math.Float64frombits(v)) 2491 case 3: 2492 if wireType != 0 { 2493 return fmt.Errorf("proto: wrong wireType = %d for field TimestampMs", wireType) 2494 } 2495 m.TimestampMs = 0 2496 for shift := uint(0); ; shift += 7 { 2497 if shift >= 64 { 2498 return ErrIntOverflowCortex 2499 } 2500 if iNdEx >= l { 2501 return io.ErrUnexpectedEOF 2502 } 2503 b := dAtA[iNdEx] 2504 iNdEx++ 2505 m.TimestampMs |= int64(b&0x7F) << shift 2506 if b < 0x80 { 2507 break 2508 } 2509 } 2510 default: 2511 iNdEx = preIndex 2512 skippy, err := skipCortex(dAtA[iNdEx:]) 2513 if err != nil { 2514 return err 2515 } 2516 if skippy < 0 { 2517 return ErrInvalidLengthCortex 2518 } 2519 if (iNdEx + skippy) < 0 { 2520 return ErrInvalidLengthCortex 2521 } 2522 if (iNdEx + skippy) > l { 2523 return io.ErrUnexpectedEOF 2524 } 2525 iNdEx += skippy 2526 } 2527 } 2528 2529 if iNdEx > l { 2530 return io.ErrUnexpectedEOF 2531 } 2532 return nil 2533 } 2534 func skipCortex(dAtA []byte) (n int, err error) { 2535 l := len(dAtA) 2536 iNdEx := 0 2537 for iNdEx < l { 2538 var wire uint64 2539 for shift := uint(0); ; shift += 7 { 2540 if shift >= 64 { 2541 return 0, ErrIntOverflowCortex 2542 } 2543 if iNdEx >= l { 2544 return 0, io.ErrUnexpectedEOF 2545 } 2546 b := dAtA[iNdEx] 2547 iNdEx++ 2548 wire |= (uint64(b) & 0x7F) << shift 2549 if b < 0x80 { 2550 break 2551 } 2552 } 2553 wireType := int(wire & 0x7) 2554 switch wireType { 2555 case 0: 2556 for shift := uint(0); ; shift += 7 { 2557 if shift >= 64 { 2558 return 0, ErrIntOverflowCortex 2559 } 2560 if iNdEx >= l { 2561 return 0, io.ErrUnexpectedEOF 2562 } 2563 iNdEx++ 2564 if dAtA[iNdEx-1] < 0x80 { 2565 break 2566 } 2567 } 2568 return iNdEx, nil 2569 case 1: 2570 iNdEx += 8 2571 return iNdEx, nil 2572 case 2: 2573 var length int 2574 for shift := uint(0); ; shift += 7 { 2575 if shift >= 64 { 2576 return 0, ErrIntOverflowCortex 2577 } 2578 if iNdEx >= l { 2579 return 0, io.ErrUnexpectedEOF 2580 } 2581 b := dAtA[iNdEx] 2582 iNdEx++ 2583 length |= (int(b) & 0x7F) << shift 2584 if b < 0x80 { 2585 break 2586 } 2587 } 2588 if length < 0 { 2589 return 0, ErrInvalidLengthCortex 2590 } 2591 iNdEx += length 2592 if iNdEx < 0 { 2593 return 0, ErrInvalidLengthCortex 2594 } 2595 return iNdEx, nil 2596 case 3: 2597 for { 2598 var innerWire uint64 2599 var start int = iNdEx 2600 for shift := uint(0); ; shift += 7 { 2601 if shift >= 64 { 2602 return 0, ErrIntOverflowCortex 2603 } 2604 if iNdEx >= l { 2605 return 0, io.ErrUnexpectedEOF 2606 } 2607 b := dAtA[iNdEx] 2608 iNdEx++ 2609 innerWire |= (uint64(b) & 0x7F) << shift 2610 if b < 0x80 { 2611 break 2612 } 2613 } 2614 innerWireType := int(innerWire & 0x7) 2615 if innerWireType == 4 { 2616 break 2617 } 2618 next, err := skipCortex(dAtA[start:]) 2619 if err != nil { 2620 return 0, err 2621 } 2622 iNdEx = start + next 2623 if iNdEx < 0 { 2624 return 0, ErrInvalidLengthCortex 2625 } 2626 } 2627 return iNdEx, nil 2628 case 4: 2629 return iNdEx, nil 2630 case 5: 2631 iNdEx += 4 2632 return iNdEx, nil 2633 default: 2634 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 2635 } 2636 } 2637 panic("unreachable") 2638 } 2639 2640 var ( 2641 ErrInvalidLengthCortex = fmt.Errorf("proto: negative length found during unmarshaling") 2642 ErrIntOverflowCortex = fmt.Errorf("proto: integer overflow") 2643 )