github.com/thanos-io/thanos@v0.32.5/pkg/metadata/metadatapb/rpc.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: metadata/metadatapb/rpc.proto 3 4 package metadatapb 5 6 import ( 7 context "context" 8 fmt "fmt" 9 io "io" 10 math "math" 11 math_bits "math/bits" 12 13 _ "github.com/gogo/protobuf/gogoproto" 14 proto "github.com/gogo/protobuf/proto" 15 storepb "github.com/thanos-io/thanos/pkg/store/storepb" 16 grpc "google.golang.org/grpc" 17 codes "google.golang.org/grpc/codes" 18 status "google.golang.org/grpc/status" 19 ) 20 21 // Reference imports to suppress errors if they are not otherwise used. 22 var _ = proto.Marshal 23 var _ = fmt.Errorf 24 var _ = math.Inf 25 26 // This is a compile-time assertion to ensure that this generated file 27 // is compatible with the proto package it is being compiled against. 28 // A compilation error at this line likely means your copy of the 29 // proto package needs to be updated. 30 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 31 32 type MetricMetadataRequest struct { 33 Metric string `protobuf:"bytes,1,opt,name=metric,proto3" json:"metric,omitempty"` 34 Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` 35 PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,3,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` 36 } 37 38 func (m *MetricMetadataRequest) Reset() { *m = MetricMetadataRequest{} } 39 func (m *MetricMetadataRequest) String() string { return proto.CompactTextString(m) } 40 func (*MetricMetadataRequest) ProtoMessage() {} 41 func (*MetricMetadataRequest) Descriptor() ([]byte, []int) { 42 return fileDescriptor_1d9ae5661e0dc3fc, []int{0} 43 } 44 func (m *MetricMetadataRequest) XXX_Unmarshal(b []byte) error { 45 return m.Unmarshal(b) 46 } 47 func (m *MetricMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 48 if deterministic { 49 return xxx_messageInfo_MetricMetadataRequest.Marshal(b, m, deterministic) 50 } else { 51 b = b[:cap(b)] 52 n, err := m.MarshalToSizedBuffer(b) 53 if err != nil { 54 return nil, err 55 } 56 return b[:n], nil 57 } 58 } 59 func (m *MetricMetadataRequest) XXX_Merge(src proto.Message) { 60 xxx_messageInfo_MetricMetadataRequest.Merge(m, src) 61 } 62 func (m *MetricMetadataRequest) XXX_Size() int { 63 return m.Size() 64 } 65 func (m *MetricMetadataRequest) XXX_DiscardUnknown() { 66 xxx_messageInfo_MetricMetadataRequest.DiscardUnknown(m) 67 } 68 69 var xxx_messageInfo_MetricMetadataRequest proto.InternalMessageInfo 70 71 type MetricMetadataResponse struct { 72 // Types that are valid to be assigned to Result: 73 // *MetricMetadataResponse_Metadata 74 // *MetricMetadataResponse_Warning 75 Result isMetricMetadataResponse_Result `protobuf_oneof:"result"` 76 } 77 78 func (m *MetricMetadataResponse) Reset() { *m = MetricMetadataResponse{} } 79 func (m *MetricMetadataResponse) String() string { return proto.CompactTextString(m) } 80 func (*MetricMetadataResponse) ProtoMessage() {} 81 func (*MetricMetadataResponse) Descriptor() ([]byte, []int) { 82 return fileDescriptor_1d9ae5661e0dc3fc, []int{1} 83 } 84 func (m *MetricMetadataResponse) XXX_Unmarshal(b []byte) error { 85 return m.Unmarshal(b) 86 } 87 func (m *MetricMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 88 if deterministic { 89 return xxx_messageInfo_MetricMetadataResponse.Marshal(b, m, deterministic) 90 } else { 91 b = b[:cap(b)] 92 n, err := m.MarshalToSizedBuffer(b) 93 if err != nil { 94 return nil, err 95 } 96 return b[:n], nil 97 } 98 } 99 func (m *MetricMetadataResponse) XXX_Merge(src proto.Message) { 100 xxx_messageInfo_MetricMetadataResponse.Merge(m, src) 101 } 102 func (m *MetricMetadataResponse) XXX_Size() int { 103 return m.Size() 104 } 105 func (m *MetricMetadataResponse) XXX_DiscardUnknown() { 106 xxx_messageInfo_MetricMetadataResponse.DiscardUnknown(m) 107 } 108 109 var xxx_messageInfo_MetricMetadataResponse proto.InternalMessageInfo 110 111 type isMetricMetadataResponse_Result interface { 112 isMetricMetadataResponse_Result() 113 MarshalTo([]byte) (int, error) 114 Size() int 115 } 116 117 type MetricMetadataResponse_Metadata struct { 118 Metadata *MetricMetadata `protobuf:"bytes,1,opt,name=metadata,proto3,oneof" json:"metadata,omitempty"` 119 } 120 type MetricMetadataResponse_Warning struct { 121 Warning string `protobuf:"bytes,2,opt,name=warning,proto3,oneof" json:"warning,omitempty"` 122 } 123 124 func (*MetricMetadataResponse_Metadata) isMetricMetadataResponse_Result() {} 125 func (*MetricMetadataResponse_Warning) isMetricMetadataResponse_Result() {} 126 127 func (m *MetricMetadataResponse) GetResult() isMetricMetadataResponse_Result { 128 if m != nil { 129 return m.Result 130 } 131 return nil 132 } 133 134 func (m *MetricMetadataResponse) GetMetadata() *MetricMetadata { 135 if x, ok := m.GetResult().(*MetricMetadataResponse_Metadata); ok { 136 return x.Metadata 137 } 138 return nil 139 } 140 141 func (m *MetricMetadataResponse) GetWarning() string { 142 if x, ok := m.GetResult().(*MetricMetadataResponse_Warning); ok { 143 return x.Warning 144 } 145 return "" 146 } 147 148 // XXX_OneofWrappers is for the internal use of the proto package. 149 func (*MetricMetadataResponse) XXX_OneofWrappers() []interface{} { 150 return []interface{}{ 151 (*MetricMetadataResponse_Metadata)(nil), 152 (*MetricMetadataResponse_Warning)(nil), 153 } 154 } 155 156 type MetricMetadata struct { 157 Metadata map[string]MetricMetadataEntry `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 158 } 159 160 func (m *MetricMetadata) Reset() { *m = MetricMetadata{} } 161 func (m *MetricMetadata) String() string { return proto.CompactTextString(m) } 162 func (*MetricMetadata) ProtoMessage() {} 163 func (*MetricMetadata) Descriptor() ([]byte, []int) { 164 return fileDescriptor_1d9ae5661e0dc3fc, []int{2} 165 } 166 func (m *MetricMetadata) XXX_Unmarshal(b []byte) error { 167 return m.Unmarshal(b) 168 } 169 func (m *MetricMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 170 if deterministic { 171 return xxx_messageInfo_MetricMetadata.Marshal(b, m, deterministic) 172 } else { 173 b = b[:cap(b)] 174 n, err := m.MarshalToSizedBuffer(b) 175 if err != nil { 176 return nil, err 177 } 178 return b[:n], nil 179 } 180 } 181 func (m *MetricMetadata) XXX_Merge(src proto.Message) { 182 xxx_messageInfo_MetricMetadata.Merge(m, src) 183 } 184 func (m *MetricMetadata) XXX_Size() int { 185 return m.Size() 186 } 187 func (m *MetricMetadata) XXX_DiscardUnknown() { 188 xxx_messageInfo_MetricMetadata.DiscardUnknown(m) 189 } 190 191 var xxx_messageInfo_MetricMetadata proto.InternalMessageInfo 192 193 type MetricMetadataEntry struct { 194 Metas []Meta `protobuf:"bytes,2,rep,name=metas,proto3" json:"metas"` 195 } 196 197 func (m *MetricMetadataEntry) Reset() { *m = MetricMetadataEntry{} } 198 func (m *MetricMetadataEntry) String() string { return proto.CompactTextString(m) } 199 func (*MetricMetadataEntry) ProtoMessage() {} 200 func (*MetricMetadataEntry) Descriptor() ([]byte, []int) { 201 return fileDescriptor_1d9ae5661e0dc3fc, []int{3} 202 } 203 func (m *MetricMetadataEntry) XXX_Unmarshal(b []byte) error { 204 return m.Unmarshal(b) 205 } 206 func (m *MetricMetadataEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 207 if deterministic { 208 return xxx_messageInfo_MetricMetadataEntry.Marshal(b, m, deterministic) 209 } else { 210 b = b[:cap(b)] 211 n, err := m.MarshalToSizedBuffer(b) 212 if err != nil { 213 return nil, err 214 } 215 return b[:n], nil 216 } 217 } 218 func (m *MetricMetadataEntry) XXX_Merge(src proto.Message) { 219 xxx_messageInfo_MetricMetadataEntry.Merge(m, src) 220 } 221 func (m *MetricMetadataEntry) XXX_Size() int { 222 return m.Size() 223 } 224 func (m *MetricMetadataEntry) XXX_DiscardUnknown() { 225 xxx_messageInfo_MetricMetadataEntry.DiscardUnknown(m) 226 } 227 228 var xxx_messageInfo_MetricMetadataEntry proto.InternalMessageInfo 229 230 type Meta struct { 231 Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type"` 232 Help string `protobuf:"bytes,2,opt,name=help,proto3" json:"help"` 233 Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit"` 234 } 235 236 func (m *Meta) Reset() { *m = Meta{} } 237 func (m *Meta) String() string { return proto.CompactTextString(m) } 238 func (*Meta) ProtoMessage() {} 239 func (*Meta) Descriptor() ([]byte, []int) { 240 return fileDescriptor_1d9ae5661e0dc3fc, []int{4} 241 } 242 func (m *Meta) XXX_Unmarshal(b []byte) error { 243 return m.Unmarshal(b) 244 } 245 func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 246 if deterministic { 247 return xxx_messageInfo_Meta.Marshal(b, m, deterministic) 248 } else { 249 b = b[:cap(b)] 250 n, err := m.MarshalToSizedBuffer(b) 251 if err != nil { 252 return nil, err 253 } 254 return b[:n], nil 255 } 256 } 257 func (m *Meta) XXX_Merge(src proto.Message) { 258 xxx_messageInfo_Meta.Merge(m, src) 259 } 260 func (m *Meta) XXX_Size() int { 261 return m.Size() 262 } 263 func (m *Meta) XXX_DiscardUnknown() { 264 xxx_messageInfo_Meta.DiscardUnknown(m) 265 } 266 267 var xxx_messageInfo_Meta proto.InternalMessageInfo 268 269 func init() { 270 proto.RegisterType((*MetricMetadataRequest)(nil), "thanos.MetricMetadataRequest") 271 proto.RegisterType((*MetricMetadataResponse)(nil), "thanos.MetricMetadataResponse") 272 proto.RegisterType((*MetricMetadata)(nil), "thanos.MetricMetadata") 273 proto.RegisterMapType((map[string]MetricMetadataEntry)(nil), "thanos.MetricMetadata.MetadataEntry") 274 proto.RegisterType((*MetricMetadataEntry)(nil), "thanos.MetricMetadataEntry") 275 proto.RegisterType((*Meta)(nil), "thanos.Meta") 276 } 277 278 func init() { proto.RegisterFile("metadata/metadatapb/rpc.proto", fileDescriptor_1d9ae5661e0dc3fc) } 279 280 var fileDescriptor_1d9ae5661e0dc3fc = []byte{ 281 // 465 bytes of a gzipped FileDescriptorProto 282 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x6e, 0x13, 0x31, 283 0x10, 0x5e, 0xe7, 0x8f, 0x74, 0x02, 0x15, 0x32, 0x25, 0xa4, 0x0b, 0xdd, 0x44, 0x2b, 0x0e, 0x7b, 284 0xca, 0xc2, 0xc2, 0x01, 0x71, 0x41, 0x8a, 0x04, 0xea, 0xa5, 0x12, 0x98, 0x0b, 0x02, 0xa1, 0xe2, 285 0x14, 0x2b, 0x5d, 0xb1, 0xd9, 0x35, 0xf6, 0x04, 0x94, 0xb7, 0xe0, 0x19, 0x78, 0x04, 0x9e, 0x22, 286 0xc7, 0x1e, 0x39, 0x55, 0x90, 0xdc, 0x78, 0x0a, 0x64, 0x7b, 0xb7, 0x34, 0xb0, 0x5c, 0x46, 0x33, 287 0xf3, 0x7d, 0x9e, 0xf9, 0x3c, 0x1e, 0xc3, 0xc1, 0x5c, 0x20, 0x7f, 0xcf, 0x91, 0xc7, 0x95, 0x23, 288 0xa7, 0xb1, 0x92, 0x27, 0x63, 0xa9, 0x0a, 0x2c, 0x68, 0x07, 0x4f, 0x79, 0x5e, 0x68, 0x7f, 0x5f, 289 0x63, 0xa1, 0x44, 0x6c, 0xad, 0x9c, 0xc6, 0xb8, 0x94, 0x42, 0x3b, 0x8a, 0xbf, 0x37, 0x2b, 0x66, 290 0x85, 0x75, 0x63, 0xe3, 0xb9, 0x6c, 0xf8, 0x95, 0xc0, 0xcd, 0x23, 0x81, 0x2a, 0x3d, 0x39, 0x2a, 291 0xeb, 0x32, 0xf1, 0x71, 0x21, 0x34, 0xd2, 0x3e, 0x74, 0xe6, 0x16, 0x18, 0x90, 0x11, 0x89, 0x76, 292 0x58, 0x19, 0xd1, 0x3d, 0x68, 0x67, 0xe9, 0x3c, 0xc5, 0x41, 0x63, 0x44, 0xa2, 0x36, 0x73, 0x01, 293 0x7d, 0x03, 0xfb, 0x92, 0x2b, 0x4c, 0x79, 0x76, 0xac, 0x84, 0x96, 0x45, 0xae, 0xc5, 0xb1, 0x46, 294 0xc5, 0x51, 0xcc, 0x96, 0x83, 0xe6, 0x88, 0x44, 0xbb, 0xc9, 0x70, 0xec, 0x44, 0x8e, 0x9f, 0x3b, 295 0x22, 0x2b, 0x79, 0x2f, 0x4b, 0x1a, 0xbb, 0x25, 0xeb, 0x81, 0x10, 0xa1, 0xff, 0xb7, 0x46, 0xc7, 296 0xa0, 0x0f, 0xa1, 0x5b, 0xcd, 0xc3, 0xca, 0xec, 0x25, 0xfd, 0xaa, 0xcb, 0xf6, 0x89, 0x43, 0x8f, 297 0x5d, 0x30, 0xa9, 0x0f, 0x57, 0x3e, 0x73, 0x95, 0xa7, 0xf9, 0xcc, 0x5e, 0x62, 0xe7, 0xd0, 0x63, 298 0x55, 0x62, 0xd2, 0x85, 0x8e, 0x12, 0x7a, 0x91, 0x61, 0xf8, 0x8d, 0xc0, 0xee, 0x76, 0x11, 0xfa, 299 0x6c, 0xab, 0x5d, 0x33, 0xea, 0x25, 0x77, 0xeb, 0xdb, 0x8d, 0x2b, 0xe7, 0x69, 0x8e, 0x6a, 0x39, 300 0x69, 0xad, 0xce, 0x87, 0x97, 0x04, 0xf8, 0xaf, 0xe0, 0xda, 0x16, 0x81, 0x5e, 0x87, 0xe6, 0x07, 301 0xb1, 0x2c, 0x27, 0x6d, 0x5c, 0x7a, 0x1f, 0xda, 0x9f, 0x78, 0xb6, 0x10, 0x56, 0x61, 0x2f, 0xb9, 302 0x5d, 0xdf, 0xc7, 0x9e, 0x66, 0x8e, 0xf9, 0xb8, 0xf1, 0x88, 0x84, 0x4f, 0xe0, 0x46, 0x0d, 0x83, 303 0x46, 0xd0, 0x36, 0xcd, 0xf5, 0xa0, 0x61, 0x55, 0x5f, 0xbd, 0x54, 0x8d, 0x97, 0xea, 0x1c, 0x21, 304 0x7c, 0x07, 0x2d, 0x93, 0xa4, 0x77, 0xa0, 0x65, 0xb6, 0xc7, 0x49, 0x9a, 0x74, 0x7f, 0x9d, 0x0f, 305 0x6d, 0xcc, 0xac, 0x35, 0xe8, 0xa9, 0xc8, 0xa4, 0x1b, 0x9f, 0x43, 0x4d, 0xcc, 0xac, 0x35, 0xe8, 306 0x22, 0x4f, 0xd1, 0xbe, 0x7b, 0x89, 0x9a, 0x98, 0x59, 0x9b, 0xbc, 0x85, 0xee, 0xc5, 0x40, 0x5f, 307 0xfc, 0x33, 0xe2, 0x83, 0xfa, 0x8b, 0x96, 0x5b, 0xe9, 0x07, 0xff, 0x83, 0xdd, 0x42, 0xdc, 0x23, 308 0x93, 0x68, 0xf5, 0x33, 0xf0, 0x56, 0xeb, 0x80, 0x9c, 0xad, 0x03, 0xf2, 0x63, 0x1d, 0x90, 0x2f, 309 0x9b, 0xc0, 0x3b, 0xdb, 0x04, 0xde, 0xf7, 0x4d, 0xe0, 0xbd, 0x86, 0x3f, 0xdf, 0x67, 0xda, 0xb1, 310 0x5f, 0xe0, 0xc1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x76, 0xe8, 0xa7, 0x5c, 0x03, 0x00, 311 0x00, 312 } 313 314 // Reference imports to suppress errors if they are not otherwise used. 315 var _ context.Context 316 var _ grpc.ClientConn 317 318 // This is a compile-time assertion to ensure that this generated file 319 // is compatible with the grpc package it is being compiled against. 320 const _ = grpc.SupportPackageIsVersion4 321 322 // MetadataClient is the client API for Metadata service. 323 // 324 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 325 type MetadataClient interface { 326 MetricMetadata(ctx context.Context, in *MetricMetadataRequest, opts ...grpc.CallOption) (Metadata_MetricMetadataClient, error) 327 } 328 329 type metadataClient struct { 330 cc *grpc.ClientConn 331 } 332 333 func NewMetadataClient(cc *grpc.ClientConn) MetadataClient { 334 return &metadataClient{cc} 335 } 336 337 func (c *metadataClient) MetricMetadata(ctx context.Context, in *MetricMetadataRequest, opts ...grpc.CallOption) (Metadata_MetricMetadataClient, error) { 338 stream, err := c.cc.NewStream(ctx, &_Metadata_serviceDesc.Streams[0], "/thanos.Metadata/MetricMetadata", opts...) 339 if err != nil { 340 return nil, err 341 } 342 x := &metadataMetricMetadataClient{stream} 343 if err := x.ClientStream.SendMsg(in); err != nil { 344 return nil, err 345 } 346 if err := x.ClientStream.CloseSend(); err != nil { 347 return nil, err 348 } 349 return x, nil 350 } 351 352 type Metadata_MetricMetadataClient interface { 353 Recv() (*MetricMetadataResponse, error) 354 grpc.ClientStream 355 } 356 357 type metadataMetricMetadataClient struct { 358 grpc.ClientStream 359 } 360 361 func (x *metadataMetricMetadataClient) Recv() (*MetricMetadataResponse, error) { 362 m := new(MetricMetadataResponse) 363 if err := x.ClientStream.RecvMsg(m); err != nil { 364 return nil, err 365 } 366 return m, nil 367 } 368 369 // MetadataServer is the server API for Metadata service. 370 type MetadataServer interface { 371 MetricMetadata(*MetricMetadataRequest, Metadata_MetricMetadataServer) error 372 } 373 374 // UnimplementedMetadataServer can be embedded to have forward compatible implementations. 375 type UnimplementedMetadataServer struct { 376 } 377 378 func (*UnimplementedMetadataServer) MetricMetadata(req *MetricMetadataRequest, srv Metadata_MetricMetadataServer) error { 379 return status.Errorf(codes.Unimplemented, "method MetricMetadata not implemented") 380 } 381 382 func RegisterMetadataServer(s *grpc.Server, srv MetadataServer) { 383 s.RegisterService(&_Metadata_serviceDesc, srv) 384 } 385 386 func _Metadata_MetricMetadata_Handler(srv interface{}, stream grpc.ServerStream) error { 387 m := new(MetricMetadataRequest) 388 if err := stream.RecvMsg(m); err != nil { 389 return err 390 } 391 return srv.(MetadataServer).MetricMetadata(m, &metadataMetricMetadataServer{stream}) 392 } 393 394 type Metadata_MetricMetadataServer interface { 395 Send(*MetricMetadataResponse) error 396 grpc.ServerStream 397 } 398 399 type metadataMetricMetadataServer struct { 400 grpc.ServerStream 401 } 402 403 func (x *metadataMetricMetadataServer) Send(m *MetricMetadataResponse) error { 404 return x.ServerStream.SendMsg(m) 405 } 406 407 var _Metadata_serviceDesc = grpc.ServiceDesc{ 408 ServiceName: "thanos.Metadata", 409 HandlerType: (*MetadataServer)(nil), 410 Methods: []grpc.MethodDesc{}, 411 Streams: []grpc.StreamDesc{ 412 { 413 StreamName: "MetricMetadata", 414 Handler: _Metadata_MetricMetadata_Handler, 415 ServerStreams: true, 416 }, 417 }, 418 Metadata: "metadata/metadatapb/rpc.proto", 419 } 420 421 func (m *MetricMetadataRequest) Marshal() (dAtA []byte, err error) { 422 size := m.Size() 423 dAtA = make([]byte, size) 424 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 425 if err != nil { 426 return nil, err 427 } 428 return dAtA[:n], nil 429 } 430 431 func (m *MetricMetadataRequest) MarshalTo(dAtA []byte) (int, error) { 432 size := m.Size() 433 return m.MarshalToSizedBuffer(dAtA[:size]) 434 } 435 436 func (m *MetricMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 437 i := len(dAtA) 438 _ = i 439 var l int 440 _ = l 441 if m.PartialResponseStrategy != 0 { 442 i = encodeVarintRpc(dAtA, i, uint64(m.PartialResponseStrategy)) 443 i-- 444 dAtA[i] = 0x18 445 } 446 if m.Limit != 0 { 447 i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) 448 i-- 449 dAtA[i] = 0x10 450 } 451 if len(m.Metric) > 0 { 452 i -= len(m.Metric) 453 copy(dAtA[i:], m.Metric) 454 i = encodeVarintRpc(dAtA, i, uint64(len(m.Metric))) 455 i-- 456 dAtA[i] = 0xa 457 } 458 return len(dAtA) - i, nil 459 } 460 461 func (m *MetricMetadataResponse) Marshal() (dAtA []byte, err error) { 462 size := m.Size() 463 dAtA = make([]byte, size) 464 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 465 if err != nil { 466 return nil, err 467 } 468 return dAtA[:n], nil 469 } 470 471 func (m *MetricMetadataResponse) MarshalTo(dAtA []byte) (int, error) { 472 size := m.Size() 473 return m.MarshalToSizedBuffer(dAtA[:size]) 474 } 475 476 func (m *MetricMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 477 i := len(dAtA) 478 _ = i 479 var l int 480 _ = l 481 if m.Result != nil { 482 { 483 size := m.Result.Size() 484 i -= size 485 if _, err := m.Result.MarshalTo(dAtA[i:]); err != nil { 486 return 0, err 487 } 488 } 489 } 490 return len(dAtA) - i, nil 491 } 492 493 func (m *MetricMetadataResponse_Metadata) MarshalTo(dAtA []byte) (int, error) { 494 size := m.Size() 495 return m.MarshalToSizedBuffer(dAtA[:size]) 496 } 497 498 func (m *MetricMetadataResponse_Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { 499 i := len(dAtA) 500 if m.Metadata != nil { 501 { 502 size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) 503 if err != nil { 504 return 0, err 505 } 506 i -= size 507 i = encodeVarintRpc(dAtA, i, uint64(size)) 508 } 509 i-- 510 dAtA[i] = 0xa 511 } 512 return len(dAtA) - i, nil 513 } 514 func (m *MetricMetadataResponse_Warning) MarshalTo(dAtA []byte) (int, error) { 515 size := m.Size() 516 return m.MarshalToSizedBuffer(dAtA[:size]) 517 } 518 519 func (m *MetricMetadataResponse_Warning) MarshalToSizedBuffer(dAtA []byte) (int, error) { 520 i := len(dAtA) 521 i -= len(m.Warning) 522 copy(dAtA[i:], m.Warning) 523 i = encodeVarintRpc(dAtA, i, uint64(len(m.Warning))) 524 i-- 525 dAtA[i] = 0x12 526 return len(dAtA) - i, nil 527 } 528 func (m *MetricMetadata) Marshal() (dAtA []byte, err error) { 529 size := m.Size() 530 dAtA = make([]byte, size) 531 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 532 if err != nil { 533 return nil, err 534 } 535 return dAtA[:n], nil 536 } 537 538 func (m *MetricMetadata) MarshalTo(dAtA []byte) (int, error) { 539 size := m.Size() 540 return m.MarshalToSizedBuffer(dAtA[:size]) 541 } 542 543 func (m *MetricMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { 544 i := len(dAtA) 545 _ = i 546 var l int 547 _ = l 548 if len(m.Metadata) > 0 { 549 for k := range m.Metadata { 550 v := m.Metadata[k] 551 baseI := i 552 { 553 size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) 554 if err != nil { 555 return 0, err 556 } 557 i -= size 558 i = encodeVarintRpc(dAtA, i, uint64(size)) 559 } 560 i-- 561 dAtA[i] = 0x12 562 i -= len(k) 563 copy(dAtA[i:], k) 564 i = encodeVarintRpc(dAtA, i, uint64(len(k))) 565 i-- 566 dAtA[i] = 0xa 567 i = encodeVarintRpc(dAtA, i, uint64(baseI-i)) 568 i-- 569 dAtA[i] = 0xa 570 } 571 } 572 return len(dAtA) - i, nil 573 } 574 575 func (m *MetricMetadataEntry) Marshal() (dAtA []byte, err error) { 576 size := m.Size() 577 dAtA = make([]byte, size) 578 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 579 if err != nil { 580 return nil, err 581 } 582 return dAtA[:n], nil 583 } 584 585 func (m *MetricMetadataEntry) MarshalTo(dAtA []byte) (int, error) { 586 size := m.Size() 587 return m.MarshalToSizedBuffer(dAtA[:size]) 588 } 589 590 func (m *MetricMetadataEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { 591 i := len(dAtA) 592 _ = i 593 var l int 594 _ = l 595 if len(m.Metas) > 0 { 596 for iNdEx := len(m.Metas) - 1; iNdEx >= 0; iNdEx-- { 597 { 598 size, err := m.Metas[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 599 if err != nil { 600 return 0, err 601 } 602 i -= size 603 i = encodeVarintRpc(dAtA, i, uint64(size)) 604 } 605 i-- 606 dAtA[i] = 0x12 607 } 608 } 609 return len(dAtA) - i, nil 610 } 611 612 func (m *Meta) Marshal() (dAtA []byte, err error) { 613 size := m.Size() 614 dAtA = make([]byte, size) 615 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 616 if err != nil { 617 return nil, err 618 } 619 return dAtA[:n], nil 620 } 621 622 func (m *Meta) MarshalTo(dAtA []byte) (int, error) { 623 size := m.Size() 624 return m.MarshalToSizedBuffer(dAtA[:size]) 625 } 626 627 func (m *Meta) MarshalToSizedBuffer(dAtA []byte) (int, error) { 628 i := len(dAtA) 629 _ = i 630 var l int 631 _ = l 632 if len(m.Unit) > 0 { 633 i -= len(m.Unit) 634 copy(dAtA[i:], m.Unit) 635 i = encodeVarintRpc(dAtA, i, uint64(len(m.Unit))) 636 i-- 637 dAtA[i] = 0x1a 638 } 639 if len(m.Help) > 0 { 640 i -= len(m.Help) 641 copy(dAtA[i:], m.Help) 642 i = encodeVarintRpc(dAtA, i, uint64(len(m.Help))) 643 i-- 644 dAtA[i] = 0x12 645 } 646 if len(m.Type) > 0 { 647 i -= len(m.Type) 648 copy(dAtA[i:], m.Type) 649 i = encodeVarintRpc(dAtA, i, uint64(len(m.Type))) 650 i-- 651 dAtA[i] = 0xa 652 } 653 return len(dAtA) - i, nil 654 } 655 656 func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { 657 offset -= sovRpc(v) 658 base := offset 659 for v >= 1<<7 { 660 dAtA[offset] = uint8(v&0x7f | 0x80) 661 v >>= 7 662 offset++ 663 } 664 dAtA[offset] = uint8(v) 665 return base 666 } 667 func (m *MetricMetadataRequest) Size() (n int) { 668 if m == nil { 669 return 0 670 } 671 var l int 672 _ = l 673 l = len(m.Metric) 674 if l > 0 { 675 n += 1 + l + sovRpc(uint64(l)) 676 } 677 if m.Limit != 0 { 678 n += 1 + sovRpc(uint64(m.Limit)) 679 } 680 if m.PartialResponseStrategy != 0 { 681 n += 1 + sovRpc(uint64(m.PartialResponseStrategy)) 682 } 683 return n 684 } 685 686 func (m *MetricMetadataResponse) Size() (n int) { 687 if m == nil { 688 return 0 689 } 690 var l int 691 _ = l 692 if m.Result != nil { 693 n += m.Result.Size() 694 } 695 return n 696 } 697 698 func (m *MetricMetadataResponse_Metadata) Size() (n int) { 699 if m == nil { 700 return 0 701 } 702 var l int 703 _ = l 704 if m.Metadata != nil { 705 l = m.Metadata.Size() 706 n += 1 + l + sovRpc(uint64(l)) 707 } 708 return n 709 } 710 func (m *MetricMetadataResponse_Warning) Size() (n int) { 711 if m == nil { 712 return 0 713 } 714 var l int 715 _ = l 716 l = len(m.Warning) 717 n += 1 + l + sovRpc(uint64(l)) 718 return n 719 } 720 func (m *MetricMetadata) Size() (n int) { 721 if m == nil { 722 return 0 723 } 724 var l int 725 _ = l 726 if len(m.Metadata) > 0 { 727 for k, v := range m.Metadata { 728 _ = k 729 _ = v 730 l = v.Size() 731 mapEntrySize := 1 + len(k) + sovRpc(uint64(len(k))) + 1 + l + sovRpc(uint64(l)) 732 n += mapEntrySize + 1 + sovRpc(uint64(mapEntrySize)) 733 } 734 } 735 return n 736 } 737 738 func (m *MetricMetadataEntry) Size() (n int) { 739 if m == nil { 740 return 0 741 } 742 var l int 743 _ = l 744 if len(m.Metas) > 0 { 745 for _, e := range m.Metas { 746 l = e.Size() 747 n += 1 + l + sovRpc(uint64(l)) 748 } 749 } 750 return n 751 } 752 753 func (m *Meta) Size() (n int) { 754 if m == nil { 755 return 0 756 } 757 var l int 758 _ = l 759 l = len(m.Type) 760 if l > 0 { 761 n += 1 + l + sovRpc(uint64(l)) 762 } 763 l = len(m.Help) 764 if l > 0 { 765 n += 1 + l + sovRpc(uint64(l)) 766 } 767 l = len(m.Unit) 768 if l > 0 { 769 n += 1 + l + sovRpc(uint64(l)) 770 } 771 return n 772 } 773 774 func sovRpc(x uint64) (n int) { 775 return (math_bits.Len64(x|1) + 6) / 7 776 } 777 func sozRpc(x uint64) (n int) { 778 return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 779 } 780 func (m *MetricMetadataRequest) Unmarshal(dAtA []byte) error { 781 l := len(dAtA) 782 iNdEx := 0 783 for iNdEx < l { 784 preIndex := iNdEx 785 var wire uint64 786 for shift := uint(0); ; shift += 7 { 787 if shift >= 64 { 788 return ErrIntOverflowRpc 789 } 790 if iNdEx >= l { 791 return io.ErrUnexpectedEOF 792 } 793 b := dAtA[iNdEx] 794 iNdEx++ 795 wire |= uint64(b&0x7F) << shift 796 if b < 0x80 { 797 break 798 } 799 } 800 fieldNum := int32(wire >> 3) 801 wireType := int(wire & 0x7) 802 if wireType == 4 { 803 return fmt.Errorf("proto: MetricMetadataRequest: wiretype end group for non-group") 804 } 805 if fieldNum <= 0 { 806 return fmt.Errorf("proto: MetricMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) 807 } 808 switch fieldNum { 809 case 1: 810 if wireType != 2 { 811 return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType) 812 } 813 var stringLen uint64 814 for shift := uint(0); ; shift += 7 { 815 if shift >= 64 { 816 return ErrIntOverflowRpc 817 } 818 if iNdEx >= l { 819 return io.ErrUnexpectedEOF 820 } 821 b := dAtA[iNdEx] 822 iNdEx++ 823 stringLen |= uint64(b&0x7F) << shift 824 if b < 0x80 { 825 break 826 } 827 } 828 intStringLen := int(stringLen) 829 if intStringLen < 0 { 830 return ErrInvalidLengthRpc 831 } 832 postIndex := iNdEx + intStringLen 833 if postIndex < 0 { 834 return ErrInvalidLengthRpc 835 } 836 if postIndex > l { 837 return io.ErrUnexpectedEOF 838 } 839 m.Metric = string(dAtA[iNdEx:postIndex]) 840 iNdEx = postIndex 841 case 2: 842 if wireType != 0 { 843 return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) 844 } 845 m.Limit = 0 846 for shift := uint(0); ; shift += 7 { 847 if shift >= 64 { 848 return ErrIntOverflowRpc 849 } 850 if iNdEx >= l { 851 return io.ErrUnexpectedEOF 852 } 853 b := dAtA[iNdEx] 854 iNdEx++ 855 m.Limit |= int32(b&0x7F) << shift 856 if b < 0x80 { 857 break 858 } 859 } 860 case 3: 861 if wireType != 0 { 862 return fmt.Errorf("proto: wrong wireType = %d for field PartialResponseStrategy", wireType) 863 } 864 m.PartialResponseStrategy = 0 865 for shift := uint(0); ; shift += 7 { 866 if shift >= 64 { 867 return ErrIntOverflowRpc 868 } 869 if iNdEx >= l { 870 return io.ErrUnexpectedEOF 871 } 872 b := dAtA[iNdEx] 873 iNdEx++ 874 m.PartialResponseStrategy |= storepb.PartialResponseStrategy(b&0x7F) << shift 875 if b < 0x80 { 876 break 877 } 878 } 879 default: 880 iNdEx = preIndex 881 skippy, err := skipRpc(dAtA[iNdEx:]) 882 if err != nil { 883 return err 884 } 885 if (skippy < 0) || (iNdEx+skippy) < 0 { 886 return ErrInvalidLengthRpc 887 } 888 if (iNdEx + skippy) > l { 889 return io.ErrUnexpectedEOF 890 } 891 iNdEx += skippy 892 } 893 } 894 895 if iNdEx > l { 896 return io.ErrUnexpectedEOF 897 } 898 return nil 899 } 900 func (m *MetricMetadataResponse) Unmarshal(dAtA []byte) error { 901 l := len(dAtA) 902 iNdEx := 0 903 for iNdEx < l { 904 preIndex := iNdEx 905 var wire uint64 906 for shift := uint(0); ; shift += 7 { 907 if shift >= 64 { 908 return ErrIntOverflowRpc 909 } 910 if iNdEx >= l { 911 return io.ErrUnexpectedEOF 912 } 913 b := dAtA[iNdEx] 914 iNdEx++ 915 wire |= uint64(b&0x7F) << shift 916 if b < 0x80 { 917 break 918 } 919 } 920 fieldNum := int32(wire >> 3) 921 wireType := int(wire & 0x7) 922 if wireType == 4 { 923 return fmt.Errorf("proto: MetricMetadataResponse: wiretype end group for non-group") 924 } 925 if fieldNum <= 0 { 926 return fmt.Errorf("proto: MetricMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) 927 } 928 switch fieldNum { 929 case 1: 930 if wireType != 2 { 931 return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) 932 } 933 var msglen int 934 for shift := uint(0); ; shift += 7 { 935 if shift >= 64 { 936 return ErrIntOverflowRpc 937 } 938 if iNdEx >= l { 939 return io.ErrUnexpectedEOF 940 } 941 b := dAtA[iNdEx] 942 iNdEx++ 943 msglen |= int(b&0x7F) << shift 944 if b < 0x80 { 945 break 946 } 947 } 948 if msglen < 0 { 949 return ErrInvalidLengthRpc 950 } 951 postIndex := iNdEx + msglen 952 if postIndex < 0 { 953 return ErrInvalidLengthRpc 954 } 955 if postIndex > l { 956 return io.ErrUnexpectedEOF 957 } 958 v := &MetricMetadata{} 959 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 960 return err 961 } 962 m.Result = &MetricMetadataResponse_Metadata{v} 963 iNdEx = postIndex 964 case 2: 965 if wireType != 2 { 966 return fmt.Errorf("proto: wrong wireType = %d for field Warning", wireType) 967 } 968 var stringLen uint64 969 for shift := uint(0); ; shift += 7 { 970 if shift >= 64 { 971 return ErrIntOverflowRpc 972 } 973 if iNdEx >= l { 974 return io.ErrUnexpectedEOF 975 } 976 b := dAtA[iNdEx] 977 iNdEx++ 978 stringLen |= uint64(b&0x7F) << shift 979 if b < 0x80 { 980 break 981 } 982 } 983 intStringLen := int(stringLen) 984 if intStringLen < 0 { 985 return ErrInvalidLengthRpc 986 } 987 postIndex := iNdEx + intStringLen 988 if postIndex < 0 { 989 return ErrInvalidLengthRpc 990 } 991 if postIndex > l { 992 return io.ErrUnexpectedEOF 993 } 994 m.Result = &MetricMetadataResponse_Warning{string(dAtA[iNdEx:postIndex])} 995 iNdEx = postIndex 996 default: 997 iNdEx = preIndex 998 skippy, err := skipRpc(dAtA[iNdEx:]) 999 if err != nil { 1000 return err 1001 } 1002 if (skippy < 0) || (iNdEx+skippy) < 0 { 1003 return ErrInvalidLengthRpc 1004 } 1005 if (iNdEx + skippy) > l { 1006 return io.ErrUnexpectedEOF 1007 } 1008 iNdEx += skippy 1009 } 1010 } 1011 1012 if iNdEx > l { 1013 return io.ErrUnexpectedEOF 1014 } 1015 return nil 1016 } 1017 func (m *MetricMetadata) Unmarshal(dAtA []byte) error { 1018 l := len(dAtA) 1019 iNdEx := 0 1020 for iNdEx < l { 1021 preIndex := iNdEx 1022 var wire uint64 1023 for shift := uint(0); ; shift += 7 { 1024 if shift >= 64 { 1025 return ErrIntOverflowRpc 1026 } 1027 if iNdEx >= l { 1028 return io.ErrUnexpectedEOF 1029 } 1030 b := dAtA[iNdEx] 1031 iNdEx++ 1032 wire |= uint64(b&0x7F) << shift 1033 if b < 0x80 { 1034 break 1035 } 1036 } 1037 fieldNum := int32(wire >> 3) 1038 wireType := int(wire & 0x7) 1039 if wireType == 4 { 1040 return fmt.Errorf("proto: MetricMetadata: wiretype end group for non-group") 1041 } 1042 if fieldNum <= 0 { 1043 return fmt.Errorf("proto: MetricMetadata: illegal tag %d (wire type %d)", fieldNum, wire) 1044 } 1045 switch fieldNum { 1046 case 1: 1047 if wireType != 2 { 1048 return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) 1049 } 1050 var msglen int 1051 for shift := uint(0); ; shift += 7 { 1052 if shift >= 64 { 1053 return ErrIntOverflowRpc 1054 } 1055 if iNdEx >= l { 1056 return io.ErrUnexpectedEOF 1057 } 1058 b := dAtA[iNdEx] 1059 iNdEx++ 1060 msglen |= int(b&0x7F) << shift 1061 if b < 0x80 { 1062 break 1063 } 1064 } 1065 if msglen < 0 { 1066 return ErrInvalidLengthRpc 1067 } 1068 postIndex := iNdEx + msglen 1069 if postIndex < 0 { 1070 return ErrInvalidLengthRpc 1071 } 1072 if postIndex > l { 1073 return io.ErrUnexpectedEOF 1074 } 1075 if m.Metadata == nil { 1076 m.Metadata = make(map[string]MetricMetadataEntry) 1077 } 1078 var mapkey string 1079 mapvalue := &MetricMetadataEntry{} 1080 for iNdEx < postIndex { 1081 entryPreIndex := iNdEx 1082 var wire uint64 1083 for shift := uint(0); ; shift += 7 { 1084 if shift >= 64 { 1085 return ErrIntOverflowRpc 1086 } 1087 if iNdEx >= l { 1088 return io.ErrUnexpectedEOF 1089 } 1090 b := dAtA[iNdEx] 1091 iNdEx++ 1092 wire |= uint64(b&0x7F) << shift 1093 if b < 0x80 { 1094 break 1095 } 1096 } 1097 fieldNum := int32(wire >> 3) 1098 if fieldNum == 1 { 1099 var stringLenmapkey uint64 1100 for shift := uint(0); ; shift += 7 { 1101 if shift >= 64 { 1102 return ErrIntOverflowRpc 1103 } 1104 if iNdEx >= l { 1105 return io.ErrUnexpectedEOF 1106 } 1107 b := dAtA[iNdEx] 1108 iNdEx++ 1109 stringLenmapkey |= uint64(b&0x7F) << shift 1110 if b < 0x80 { 1111 break 1112 } 1113 } 1114 intStringLenmapkey := int(stringLenmapkey) 1115 if intStringLenmapkey < 0 { 1116 return ErrInvalidLengthRpc 1117 } 1118 postStringIndexmapkey := iNdEx + intStringLenmapkey 1119 if postStringIndexmapkey < 0 { 1120 return ErrInvalidLengthRpc 1121 } 1122 if postStringIndexmapkey > l { 1123 return io.ErrUnexpectedEOF 1124 } 1125 mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) 1126 iNdEx = postStringIndexmapkey 1127 } else if fieldNum == 2 { 1128 var mapmsglen int 1129 for shift := uint(0); ; shift += 7 { 1130 if shift >= 64 { 1131 return ErrIntOverflowRpc 1132 } 1133 if iNdEx >= l { 1134 return io.ErrUnexpectedEOF 1135 } 1136 b := dAtA[iNdEx] 1137 iNdEx++ 1138 mapmsglen |= int(b&0x7F) << shift 1139 if b < 0x80 { 1140 break 1141 } 1142 } 1143 if mapmsglen < 0 { 1144 return ErrInvalidLengthRpc 1145 } 1146 postmsgIndex := iNdEx + mapmsglen 1147 if postmsgIndex < 0 { 1148 return ErrInvalidLengthRpc 1149 } 1150 if postmsgIndex > l { 1151 return io.ErrUnexpectedEOF 1152 } 1153 mapvalue = &MetricMetadataEntry{} 1154 if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { 1155 return err 1156 } 1157 iNdEx = postmsgIndex 1158 } else { 1159 iNdEx = entryPreIndex 1160 skippy, err := skipRpc(dAtA[iNdEx:]) 1161 if err != nil { 1162 return err 1163 } 1164 if (skippy < 0) || (iNdEx+skippy) < 0 { 1165 return ErrInvalidLengthRpc 1166 } 1167 if (iNdEx + skippy) > postIndex { 1168 return io.ErrUnexpectedEOF 1169 } 1170 iNdEx += skippy 1171 } 1172 } 1173 m.Metadata[mapkey] = *mapvalue 1174 iNdEx = postIndex 1175 default: 1176 iNdEx = preIndex 1177 skippy, err := skipRpc(dAtA[iNdEx:]) 1178 if err != nil { 1179 return err 1180 } 1181 if (skippy < 0) || (iNdEx+skippy) < 0 { 1182 return ErrInvalidLengthRpc 1183 } 1184 if (iNdEx + skippy) > l { 1185 return io.ErrUnexpectedEOF 1186 } 1187 iNdEx += skippy 1188 } 1189 } 1190 1191 if iNdEx > l { 1192 return io.ErrUnexpectedEOF 1193 } 1194 return nil 1195 } 1196 func (m *MetricMetadataEntry) Unmarshal(dAtA []byte) error { 1197 l := len(dAtA) 1198 iNdEx := 0 1199 for iNdEx < l { 1200 preIndex := iNdEx 1201 var wire uint64 1202 for shift := uint(0); ; shift += 7 { 1203 if shift >= 64 { 1204 return ErrIntOverflowRpc 1205 } 1206 if iNdEx >= l { 1207 return io.ErrUnexpectedEOF 1208 } 1209 b := dAtA[iNdEx] 1210 iNdEx++ 1211 wire |= uint64(b&0x7F) << shift 1212 if b < 0x80 { 1213 break 1214 } 1215 } 1216 fieldNum := int32(wire >> 3) 1217 wireType := int(wire & 0x7) 1218 if wireType == 4 { 1219 return fmt.Errorf("proto: MetricMetadataEntry: wiretype end group for non-group") 1220 } 1221 if fieldNum <= 0 { 1222 return fmt.Errorf("proto: MetricMetadataEntry: illegal tag %d (wire type %d)", fieldNum, wire) 1223 } 1224 switch fieldNum { 1225 case 2: 1226 if wireType != 2 { 1227 return fmt.Errorf("proto: wrong wireType = %d for field Metas", wireType) 1228 } 1229 var msglen int 1230 for shift := uint(0); ; shift += 7 { 1231 if shift >= 64 { 1232 return ErrIntOverflowRpc 1233 } 1234 if iNdEx >= l { 1235 return io.ErrUnexpectedEOF 1236 } 1237 b := dAtA[iNdEx] 1238 iNdEx++ 1239 msglen |= int(b&0x7F) << shift 1240 if b < 0x80 { 1241 break 1242 } 1243 } 1244 if msglen < 0 { 1245 return ErrInvalidLengthRpc 1246 } 1247 postIndex := iNdEx + msglen 1248 if postIndex < 0 { 1249 return ErrInvalidLengthRpc 1250 } 1251 if postIndex > l { 1252 return io.ErrUnexpectedEOF 1253 } 1254 m.Metas = append(m.Metas, Meta{}) 1255 if err := m.Metas[len(m.Metas)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1256 return err 1257 } 1258 iNdEx = postIndex 1259 default: 1260 iNdEx = preIndex 1261 skippy, err := skipRpc(dAtA[iNdEx:]) 1262 if err != nil { 1263 return err 1264 } 1265 if (skippy < 0) || (iNdEx+skippy) < 0 { 1266 return ErrInvalidLengthRpc 1267 } 1268 if (iNdEx + skippy) > l { 1269 return io.ErrUnexpectedEOF 1270 } 1271 iNdEx += skippy 1272 } 1273 } 1274 1275 if iNdEx > l { 1276 return io.ErrUnexpectedEOF 1277 } 1278 return nil 1279 } 1280 func (m *Meta) Unmarshal(dAtA []byte) error { 1281 l := len(dAtA) 1282 iNdEx := 0 1283 for iNdEx < l { 1284 preIndex := iNdEx 1285 var wire uint64 1286 for shift := uint(0); ; shift += 7 { 1287 if shift >= 64 { 1288 return ErrIntOverflowRpc 1289 } 1290 if iNdEx >= l { 1291 return io.ErrUnexpectedEOF 1292 } 1293 b := dAtA[iNdEx] 1294 iNdEx++ 1295 wire |= uint64(b&0x7F) << shift 1296 if b < 0x80 { 1297 break 1298 } 1299 } 1300 fieldNum := int32(wire >> 3) 1301 wireType := int(wire & 0x7) 1302 if wireType == 4 { 1303 return fmt.Errorf("proto: Meta: wiretype end group for non-group") 1304 } 1305 if fieldNum <= 0 { 1306 return fmt.Errorf("proto: Meta: illegal tag %d (wire type %d)", fieldNum, wire) 1307 } 1308 switch fieldNum { 1309 case 1: 1310 if wireType != 2 { 1311 return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) 1312 } 1313 var stringLen uint64 1314 for shift := uint(0); ; shift += 7 { 1315 if shift >= 64 { 1316 return ErrIntOverflowRpc 1317 } 1318 if iNdEx >= l { 1319 return io.ErrUnexpectedEOF 1320 } 1321 b := dAtA[iNdEx] 1322 iNdEx++ 1323 stringLen |= uint64(b&0x7F) << shift 1324 if b < 0x80 { 1325 break 1326 } 1327 } 1328 intStringLen := int(stringLen) 1329 if intStringLen < 0 { 1330 return ErrInvalidLengthRpc 1331 } 1332 postIndex := iNdEx + intStringLen 1333 if postIndex < 0 { 1334 return ErrInvalidLengthRpc 1335 } 1336 if postIndex > l { 1337 return io.ErrUnexpectedEOF 1338 } 1339 m.Type = string(dAtA[iNdEx:postIndex]) 1340 iNdEx = postIndex 1341 case 2: 1342 if wireType != 2 { 1343 return fmt.Errorf("proto: wrong wireType = %d for field Help", wireType) 1344 } 1345 var stringLen uint64 1346 for shift := uint(0); ; shift += 7 { 1347 if shift >= 64 { 1348 return ErrIntOverflowRpc 1349 } 1350 if iNdEx >= l { 1351 return io.ErrUnexpectedEOF 1352 } 1353 b := dAtA[iNdEx] 1354 iNdEx++ 1355 stringLen |= uint64(b&0x7F) << shift 1356 if b < 0x80 { 1357 break 1358 } 1359 } 1360 intStringLen := int(stringLen) 1361 if intStringLen < 0 { 1362 return ErrInvalidLengthRpc 1363 } 1364 postIndex := iNdEx + intStringLen 1365 if postIndex < 0 { 1366 return ErrInvalidLengthRpc 1367 } 1368 if postIndex > l { 1369 return io.ErrUnexpectedEOF 1370 } 1371 m.Help = string(dAtA[iNdEx:postIndex]) 1372 iNdEx = postIndex 1373 case 3: 1374 if wireType != 2 { 1375 return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) 1376 } 1377 var stringLen uint64 1378 for shift := uint(0); ; shift += 7 { 1379 if shift >= 64 { 1380 return ErrIntOverflowRpc 1381 } 1382 if iNdEx >= l { 1383 return io.ErrUnexpectedEOF 1384 } 1385 b := dAtA[iNdEx] 1386 iNdEx++ 1387 stringLen |= uint64(b&0x7F) << shift 1388 if b < 0x80 { 1389 break 1390 } 1391 } 1392 intStringLen := int(stringLen) 1393 if intStringLen < 0 { 1394 return ErrInvalidLengthRpc 1395 } 1396 postIndex := iNdEx + intStringLen 1397 if postIndex < 0 { 1398 return ErrInvalidLengthRpc 1399 } 1400 if postIndex > l { 1401 return io.ErrUnexpectedEOF 1402 } 1403 m.Unit = string(dAtA[iNdEx:postIndex]) 1404 iNdEx = postIndex 1405 default: 1406 iNdEx = preIndex 1407 skippy, err := skipRpc(dAtA[iNdEx:]) 1408 if err != nil { 1409 return err 1410 } 1411 if (skippy < 0) || (iNdEx+skippy) < 0 { 1412 return ErrInvalidLengthRpc 1413 } 1414 if (iNdEx + skippy) > l { 1415 return io.ErrUnexpectedEOF 1416 } 1417 iNdEx += skippy 1418 } 1419 } 1420 1421 if iNdEx > l { 1422 return io.ErrUnexpectedEOF 1423 } 1424 return nil 1425 } 1426 func skipRpc(dAtA []byte) (n int, err error) { 1427 l := len(dAtA) 1428 iNdEx := 0 1429 depth := 0 1430 for iNdEx < l { 1431 var wire uint64 1432 for shift := uint(0); ; shift += 7 { 1433 if shift >= 64 { 1434 return 0, ErrIntOverflowRpc 1435 } 1436 if iNdEx >= l { 1437 return 0, io.ErrUnexpectedEOF 1438 } 1439 b := dAtA[iNdEx] 1440 iNdEx++ 1441 wire |= (uint64(b) & 0x7F) << shift 1442 if b < 0x80 { 1443 break 1444 } 1445 } 1446 wireType := int(wire & 0x7) 1447 switch wireType { 1448 case 0: 1449 for shift := uint(0); ; shift += 7 { 1450 if shift >= 64 { 1451 return 0, ErrIntOverflowRpc 1452 } 1453 if iNdEx >= l { 1454 return 0, io.ErrUnexpectedEOF 1455 } 1456 iNdEx++ 1457 if dAtA[iNdEx-1] < 0x80 { 1458 break 1459 } 1460 } 1461 case 1: 1462 iNdEx += 8 1463 case 2: 1464 var length int 1465 for shift := uint(0); ; shift += 7 { 1466 if shift >= 64 { 1467 return 0, ErrIntOverflowRpc 1468 } 1469 if iNdEx >= l { 1470 return 0, io.ErrUnexpectedEOF 1471 } 1472 b := dAtA[iNdEx] 1473 iNdEx++ 1474 length |= (int(b) & 0x7F) << shift 1475 if b < 0x80 { 1476 break 1477 } 1478 } 1479 if length < 0 { 1480 return 0, ErrInvalidLengthRpc 1481 } 1482 iNdEx += length 1483 case 3: 1484 depth++ 1485 case 4: 1486 if depth == 0 { 1487 return 0, ErrUnexpectedEndOfGroupRpc 1488 } 1489 depth-- 1490 case 5: 1491 iNdEx += 4 1492 default: 1493 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1494 } 1495 if iNdEx < 0 { 1496 return 0, ErrInvalidLengthRpc 1497 } 1498 if depth == 0 { 1499 return iNdEx, nil 1500 } 1501 } 1502 return 0, io.ErrUnexpectedEOF 1503 } 1504 1505 var ( 1506 ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") 1507 ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") 1508 ErrUnexpectedEndOfGroupRpc = fmt.Errorf("proto: unexpected end of group") 1509 )