github.com/demonoid81/containerd@v1.3.4/api/services/ttrpc/events/v1/events.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto 3 4 package events 5 6 import ( 7 context "context" 8 fmt "fmt" 9 github_com_containerd_ttrpc "github.com/containerd/ttrpc" 10 github_com_containerd_typeurl "github.com/containerd/typeurl" 11 proto "github.com/gogo/protobuf/proto" 12 github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" 13 types "github.com/gogo/protobuf/types" 14 io "io" 15 math "math" 16 reflect "reflect" 17 strings "strings" 18 time "time" 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 var _ = time.Kitchen 26 27 // This is a compile-time assertion to ensure that this generated file 28 // is compatible with the proto package it is being compiled against. 29 // A compilation error at this line likely means your copy of the 30 // proto package needs to be updated. 31 const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package 32 33 type ForwardRequest struct { 34 Envelope *Envelope `protobuf:"bytes,1,opt,name=envelope,proto3" json:"envelope,omitempty"` 35 XXX_NoUnkeyedLiteral struct{} `json:"-"` 36 XXX_unrecognized []byte `json:"-"` 37 XXX_sizecache int32 `json:"-"` 38 } 39 40 func (m *ForwardRequest) Reset() { *m = ForwardRequest{} } 41 func (*ForwardRequest) ProtoMessage() {} 42 func (*ForwardRequest) Descriptor() ([]byte, []int) { 43 return fileDescriptor_19f98672016720b5, []int{0} 44 } 45 func (m *ForwardRequest) XXX_Unmarshal(b []byte) error { 46 return m.Unmarshal(b) 47 } 48 func (m *ForwardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 49 if deterministic { 50 return xxx_messageInfo_ForwardRequest.Marshal(b, m, deterministic) 51 } else { 52 b = b[:cap(b)] 53 n, err := m.MarshalTo(b) 54 if err != nil { 55 return nil, err 56 } 57 return b[:n], nil 58 } 59 } 60 func (m *ForwardRequest) XXX_Merge(src proto.Message) { 61 xxx_messageInfo_ForwardRequest.Merge(m, src) 62 } 63 func (m *ForwardRequest) XXX_Size() int { 64 return m.Size() 65 } 66 func (m *ForwardRequest) XXX_DiscardUnknown() { 67 xxx_messageInfo_ForwardRequest.DiscardUnknown(m) 68 } 69 70 var xxx_messageInfo_ForwardRequest proto.InternalMessageInfo 71 72 type Envelope struct { 73 Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"` 74 Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` 75 Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` 76 Event *types.Any `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"` 77 XXX_NoUnkeyedLiteral struct{} `json:"-"` 78 XXX_unrecognized []byte `json:"-"` 79 XXX_sizecache int32 `json:"-"` 80 } 81 82 func (m *Envelope) Reset() { *m = Envelope{} } 83 func (*Envelope) ProtoMessage() {} 84 func (*Envelope) Descriptor() ([]byte, []int) { 85 return fileDescriptor_19f98672016720b5, []int{1} 86 } 87 func (m *Envelope) XXX_Unmarshal(b []byte) error { 88 return m.Unmarshal(b) 89 } 90 func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 91 if deterministic { 92 return xxx_messageInfo_Envelope.Marshal(b, m, deterministic) 93 } else { 94 b = b[:cap(b)] 95 n, err := m.MarshalTo(b) 96 if err != nil { 97 return nil, err 98 } 99 return b[:n], nil 100 } 101 } 102 func (m *Envelope) XXX_Merge(src proto.Message) { 103 xxx_messageInfo_Envelope.Merge(m, src) 104 } 105 func (m *Envelope) XXX_Size() int { 106 return m.Size() 107 } 108 func (m *Envelope) XXX_DiscardUnknown() { 109 xxx_messageInfo_Envelope.DiscardUnknown(m) 110 } 111 112 var xxx_messageInfo_Envelope proto.InternalMessageInfo 113 114 func init() { 115 proto.RegisterType((*ForwardRequest)(nil), "containerd.services.events.ttrpc.v1.ForwardRequest") 116 proto.RegisterType((*Envelope)(nil), "containerd.services.events.ttrpc.v1.Envelope") 117 } 118 119 func init() { 120 proto.RegisterFile("github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto", fileDescriptor_19f98672016720b5) 121 } 122 123 var fileDescriptor_19f98672016720b5 = []byte{ 124 // 396 bytes of a gzipped FileDescriptorProto 125 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x52, 0xc1, 0x8e, 0xd3, 0x30, 126 0x10, 0x8d, 0x61, 0x77, 0x69, 0x8d, 0xc4, 0xc1, 0xaa, 0x50, 0x08, 0x28, 0x59, 0x2d, 0x97, 0x15, 127 0x12, 0xb6, 0x76, 0xf7, 0x06, 0x17, 0xa8, 0x28, 0x12, 0x1c, 0x23, 0x84, 0x2a, 0x90, 0x10, 0x6e, 128 0x3a, 0x4d, 0x2d, 0x25, 0xb6, 0x49, 0x9c, 0xa0, 0xde, 0xfa, 0x09, 0x7c, 0x0c, 0x17, 0xfe, 0xa0, 129 0x47, 0x8e, 0x9c, 0x80, 0xe6, 0x4b, 0x50, 0x9d, 0xa4, 0x81, 0xf6, 0x40, 0xa5, 0xbd, 0xbd, 0xcc, 130 0x7b, 0x6f, 0xde, 0xcc, 0xc4, 0xf8, 0x75, 0x2c, 0xcc, 0xbc, 0x98, 0xd0, 0x48, 0xa5, 0x2c, 0x52, 131 0xd2, 0x70, 0x21, 0x21, 0x9b, 0xfe, 0x0d, 0xb9, 0x16, 0x2c, 0x87, 0xac, 0x14, 0x11, 0xe4, 0xcc, 132 0x98, 0x4c, 0x47, 0x0c, 0x4a, 0x90, 0x26, 0x67, 0xe5, 0x45, 0x83, 0xa8, 0xce, 0x94, 0x51, 0xe4, 133 0x61, 0xe7, 0xa2, 0xad, 0x83, 0x36, 0x0a, 0x6b, 0xa4, 0xe5, 0x85, 0xf7, 0xec, 0xbf, 0x81, 0xb6, 134 0xd9, 0xa4, 0x98, 0x31, 0x9d, 0x14, 0xb1, 0x90, 0x6c, 0x26, 0x20, 0x99, 0x6a, 0x6e, 0xe6, 0x75, 135 0x8c, 0x37, 0x88, 0x55, 0xac, 0x2c, 0x64, 0x1b, 0xd4, 0x54, 0xef, 0xc5, 0x4a, 0xc5, 0x09, 0x74, 136 0x6e, 0x2e, 0x17, 0x0d, 0x75, 0x7f, 0x97, 0x82, 0x54, 0x9b, 0x96, 0x0c, 0x76, 0x49, 0x23, 0x52, 137 0xc8, 0x0d, 0x4f, 0x75, 0x2d, 0x38, 0x7b, 0x8f, 0xef, 0xbc, 0x54, 0xd9, 0x67, 0x9e, 0x4d, 0x43, 138 0xf8, 0x54, 0x40, 0x6e, 0xc8, 0x2b, 0xdc, 0x03, 0x59, 0x42, 0xa2, 0x34, 0xb8, 0xe8, 0x14, 0x9d, 139 0xdf, 0xbe, 0x7c, 0x4c, 0x0f, 0x58, 0x9d, 0x8e, 0x1a, 0x53, 0xb8, 0xb5, 0x9f, 0x7d, 0x45, 0xb8, 140 0xd7, 0x96, 0xc9, 0x10, 0xf7, 0xb7, 0xe1, 0x4d, 0x63, 0x8f, 0xd6, 0xe3, 0xd1, 0x76, 0x3c, 0xfa, 141 0xa6, 0x55, 0x0c, 0x7b, 0xab, 0x9f, 0x81, 0xf3, 0xe5, 0x57, 0x80, 0xc2, 0xce, 0x46, 0x1e, 0xe0, 142 0xbe, 0xe4, 0x29, 0xe4, 0x9a, 0x47, 0xe0, 0xde, 0x38, 0x45, 0xe7, 0xfd, 0xb0, 0x2b, 0x90, 0x01, 143 0x3e, 0x36, 0x4a, 0x8b, 0xc8, 0xbd, 0x69, 0x99, 0xfa, 0x83, 0x3c, 0xc2, 0xc7, 0x76, 0x54, 0xf7, 144 0xc8, 0x66, 0x0e, 0xf6, 0x32, 0x9f, 0xcb, 0x45, 0x58, 0x4b, 0x9e, 0x1c, 0x2d, 0xbf, 0x05, 0xe8, 145 0xf2, 0x23, 0x3e, 0x19, 0xd9, 0xe5, 0xc8, 0x5b, 0x7c, 0xab, 0xb9, 0x0e, 0xb9, 0x3a, 0xe8, 0x08, 146 0xff, 0xde, 0xd2, 0xbb, 0xbb, 0x17, 0x36, 0xda, 0xfc, 0x9c, 0xe1, 0x87, 0xd5, 0xda, 0x77, 0x7e, 147 0xac, 0x7d, 0x67, 0x59, 0xf9, 0x68, 0x55, 0xf9, 0xe8, 0x7b, 0xe5, 0xa3, 0xdf, 0x95, 0x8f, 0xde, 148 0xbd, 0xb8, 0xd6, 0x8b, 0x7d, 0x5a, 0xa3, 0xb1, 0x33, 0x46, 0x93, 0x13, 0x9b, 0x79, 0xf5, 0x27, 149 0x00, 0x00, 0xff, 0xff, 0xd4, 0x90, 0xbd, 0x09, 0x04, 0x03, 0x00, 0x00, 150 } 151 152 // Field returns the value for the given fieldpath as a string, if defined. 153 // If the value is not defined, the second value will be false. 154 func (m *Envelope) Field(fieldpath []string) (string, bool) { 155 if len(fieldpath) == 0 { 156 return "", false 157 } 158 159 switch fieldpath[0] { 160 // unhandled: timestamp 161 case "namespace": 162 return string(m.Namespace), len(m.Namespace) > 0 163 case "topic": 164 return string(m.Topic), len(m.Topic) > 0 165 case "event": 166 decoded, err := github_com_containerd_typeurl.UnmarshalAny(m.Event) 167 if err != nil { 168 return "", false 169 } 170 171 adaptor, ok := decoded.(interface{ Field([]string) (string, bool) }) 172 if !ok { 173 return "", false 174 } 175 return adaptor.Field(fieldpath[1:]) 176 } 177 return "", false 178 } 179 func (m *ForwardRequest) Marshal() (dAtA []byte, err error) { 180 size := m.Size() 181 dAtA = make([]byte, size) 182 n, err := m.MarshalTo(dAtA) 183 if err != nil { 184 return nil, err 185 } 186 return dAtA[:n], nil 187 } 188 189 func (m *ForwardRequest) MarshalTo(dAtA []byte) (int, error) { 190 var i int 191 _ = i 192 var l int 193 _ = l 194 if m.Envelope != nil { 195 dAtA[i] = 0xa 196 i++ 197 i = encodeVarintEvents(dAtA, i, uint64(m.Envelope.Size())) 198 n1, err := m.Envelope.MarshalTo(dAtA[i:]) 199 if err != nil { 200 return 0, err 201 } 202 i += n1 203 } 204 if m.XXX_unrecognized != nil { 205 i += copy(dAtA[i:], m.XXX_unrecognized) 206 } 207 return i, nil 208 } 209 210 func (m *Envelope) Marshal() (dAtA []byte, err error) { 211 size := m.Size() 212 dAtA = make([]byte, size) 213 n, err := m.MarshalTo(dAtA) 214 if err != nil { 215 return nil, err 216 } 217 return dAtA[:n], nil 218 } 219 220 func (m *Envelope) MarshalTo(dAtA []byte) (int, error) { 221 var i int 222 _ = i 223 var l int 224 _ = l 225 dAtA[i] = 0xa 226 i++ 227 i = encodeVarintEvents(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) 228 n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) 229 if err != nil { 230 return 0, err 231 } 232 i += n2 233 if len(m.Namespace) > 0 { 234 dAtA[i] = 0x12 235 i++ 236 i = encodeVarintEvents(dAtA, i, uint64(len(m.Namespace))) 237 i += copy(dAtA[i:], m.Namespace) 238 } 239 if len(m.Topic) > 0 { 240 dAtA[i] = 0x1a 241 i++ 242 i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic))) 243 i += copy(dAtA[i:], m.Topic) 244 } 245 if m.Event != nil { 246 dAtA[i] = 0x22 247 i++ 248 i = encodeVarintEvents(dAtA, i, uint64(m.Event.Size())) 249 n3, err := m.Event.MarshalTo(dAtA[i:]) 250 if err != nil { 251 return 0, err 252 } 253 i += n3 254 } 255 if m.XXX_unrecognized != nil { 256 i += copy(dAtA[i:], m.XXX_unrecognized) 257 } 258 return i, nil 259 } 260 261 func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { 262 for v >= 1<<7 { 263 dAtA[offset] = uint8(v&0x7f | 0x80) 264 v >>= 7 265 offset++ 266 } 267 dAtA[offset] = uint8(v) 268 return offset + 1 269 } 270 func (m *ForwardRequest) Size() (n int) { 271 if m == nil { 272 return 0 273 } 274 var l int 275 _ = l 276 if m.Envelope != nil { 277 l = m.Envelope.Size() 278 n += 1 + l + sovEvents(uint64(l)) 279 } 280 if m.XXX_unrecognized != nil { 281 n += len(m.XXX_unrecognized) 282 } 283 return n 284 } 285 286 func (m *Envelope) Size() (n int) { 287 if m == nil { 288 return 0 289 } 290 var l int 291 _ = l 292 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) 293 n += 1 + l + sovEvents(uint64(l)) 294 l = len(m.Namespace) 295 if l > 0 { 296 n += 1 + l + sovEvents(uint64(l)) 297 } 298 l = len(m.Topic) 299 if l > 0 { 300 n += 1 + l + sovEvents(uint64(l)) 301 } 302 if m.Event != nil { 303 l = m.Event.Size() 304 n += 1 + l + sovEvents(uint64(l)) 305 } 306 if m.XXX_unrecognized != nil { 307 n += len(m.XXX_unrecognized) 308 } 309 return n 310 } 311 312 func sovEvents(x uint64) (n int) { 313 for { 314 n++ 315 x >>= 7 316 if x == 0 { 317 break 318 } 319 } 320 return n 321 } 322 func sozEvents(x uint64) (n int) { 323 return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 324 } 325 func (this *ForwardRequest) String() string { 326 if this == nil { 327 return "nil" 328 } 329 s := strings.Join([]string{`&ForwardRequest{`, 330 `Envelope:` + strings.Replace(fmt.Sprintf("%v", this.Envelope), "Envelope", "Envelope", 1) + `,`, 331 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 332 `}`, 333 }, "") 334 return s 335 } 336 func (this *Envelope) String() string { 337 if this == nil { 338 return "nil" 339 } 340 s := strings.Join([]string{`&Envelope{`, 341 `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, 342 `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, 343 `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, 344 `Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "types.Any", 1) + `,`, 345 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 346 `}`, 347 }, "") 348 return s 349 } 350 func valueToStringEvents(v interface{}) string { 351 rv := reflect.ValueOf(v) 352 if rv.IsNil() { 353 return "nil" 354 } 355 pv := reflect.Indirect(rv).Interface() 356 return fmt.Sprintf("*%v", pv) 357 } 358 359 type EventsService interface { 360 Forward(ctx context.Context, req *ForwardRequest) (*types.Empty, error) 361 } 362 363 func RegisterEventsService(srv *github_com_containerd_ttrpc.Server, svc EventsService) { 364 srv.Register("containerd.services.events.ttrpc.v1.Events", map[string]github_com_containerd_ttrpc.Method{ 365 "Forward": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { 366 var req ForwardRequest 367 if err := unmarshal(&req); err != nil { 368 return nil, err 369 } 370 return svc.Forward(ctx, &req) 371 }, 372 }) 373 } 374 375 type eventsClient struct { 376 client *github_com_containerd_ttrpc.Client 377 } 378 379 func NewEventsClient(client *github_com_containerd_ttrpc.Client) EventsService { 380 return &eventsClient{ 381 client: client, 382 } 383 } 384 385 func (c *eventsClient) Forward(ctx context.Context, req *ForwardRequest) (*types.Empty, error) { 386 var resp types.Empty 387 if err := c.client.Call(ctx, "containerd.services.events.ttrpc.v1.Events", "Forward", req, &resp); err != nil { 388 return nil, err 389 } 390 return &resp, nil 391 } 392 func (m *ForwardRequest) Unmarshal(dAtA []byte) error { 393 l := len(dAtA) 394 iNdEx := 0 395 for iNdEx < l { 396 preIndex := iNdEx 397 var wire uint64 398 for shift := uint(0); ; shift += 7 { 399 if shift >= 64 { 400 return ErrIntOverflowEvents 401 } 402 if iNdEx >= l { 403 return io.ErrUnexpectedEOF 404 } 405 b := dAtA[iNdEx] 406 iNdEx++ 407 wire |= uint64(b&0x7F) << shift 408 if b < 0x80 { 409 break 410 } 411 } 412 fieldNum := int32(wire >> 3) 413 wireType := int(wire & 0x7) 414 if wireType == 4 { 415 return fmt.Errorf("proto: ForwardRequest: wiretype end group for non-group") 416 } 417 if fieldNum <= 0 { 418 return fmt.Errorf("proto: ForwardRequest: illegal tag %d (wire type %d)", fieldNum, wire) 419 } 420 switch fieldNum { 421 case 1: 422 if wireType != 2 { 423 return fmt.Errorf("proto: wrong wireType = %d for field Envelope", wireType) 424 } 425 var msglen int 426 for shift := uint(0); ; shift += 7 { 427 if shift >= 64 { 428 return ErrIntOverflowEvents 429 } 430 if iNdEx >= l { 431 return io.ErrUnexpectedEOF 432 } 433 b := dAtA[iNdEx] 434 iNdEx++ 435 msglen |= int(b&0x7F) << shift 436 if b < 0x80 { 437 break 438 } 439 } 440 if msglen < 0 { 441 return ErrInvalidLengthEvents 442 } 443 postIndex := iNdEx + msglen 444 if postIndex < 0 { 445 return ErrInvalidLengthEvents 446 } 447 if postIndex > l { 448 return io.ErrUnexpectedEOF 449 } 450 if m.Envelope == nil { 451 m.Envelope = &Envelope{} 452 } 453 if err := m.Envelope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 454 return err 455 } 456 iNdEx = postIndex 457 default: 458 iNdEx = preIndex 459 skippy, err := skipEvents(dAtA[iNdEx:]) 460 if err != nil { 461 return err 462 } 463 if skippy < 0 { 464 return ErrInvalidLengthEvents 465 } 466 if (iNdEx + skippy) < 0 { 467 return ErrInvalidLengthEvents 468 } 469 if (iNdEx + skippy) > l { 470 return io.ErrUnexpectedEOF 471 } 472 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 473 iNdEx += skippy 474 } 475 } 476 477 if iNdEx > l { 478 return io.ErrUnexpectedEOF 479 } 480 return nil 481 } 482 func (m *Envelope) Unmarshal(dAtA []byte) error { 483 l := len(dAtA) 484 iNdEx := 0 485 for iNdEx < l { 486 preIndex := iNdEx 487 var wire uint64 488 for shift := uint(0); ; shift += 7 { 489 if shift >= 64 { 490 return ErrIntOverflowEvents 491 } 492 if iNdEx >= l { 493 return io.ErrUnexpectedEOF 494 } 495 b := dAtA[iNdEx] 496 iNdEx++ 497 wire |= uint64(b&0x7F) << shift 498 if b < 0x80 { 499 break 500 } 501 } 502 fieldNum := int32(wire >> 3) 503 wireType := int(wire & 0x7) 504 if wireType == 4 { 505 return fmt.Errorf("proto: Envelope: wiretype end group for non-group") 506 } 507 if fieldNum <= 0 { 508 return fmt.Errorf("proto: Envelope: illegal tag %d (wire type %d)", fieldNum, wire) 509 } 510 switch fieldNum { 511 case 1: 512 if wireType != 2 { 513 return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) 514 } 515 var msglen int 516 for shift := uint(0); ; shift += 7 { 517 if shift >= 64 { 518 return ErrIntOverflowEvents 519 } 520 if iNdEx >= l { 521 return io.ErrUnexpectedEOF 522 } 523 b := dAtA[iNdEx] 524 iNdEx++ 525 msglen |= int(b&0x7F) << shift 526 if b < 0x80 { 527 break 528 } 529 } 530 if msglen < 0 { 531 return ErrInvalidLengthEvents 532 } 533 postIndex := iNdEx + msglen 534 if postIndex < 0 { 535 return ErrInvalidLengthEvents 536 } 537 if postIndex > l { 538 return io.ErrUnexpectedEOF 539 } 540 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { 541 return err 542 } 543 iNdEx = postIndex 544 case 2: 545 if wireType != 2 { 546 return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) 547 } 548 var stringLen uint64 549 for shift := uint(0); ; shift += 7 { 550 if shift >= 64 { 551 return ErrIntOverflowEvents 552 } 553 if iNdEx >= l { 554 return io.ErrUnexpectedEOF 555 } 556 b := dAtA[iNdEx] 557 iNdEx++ 558 stringLen |= uint64(b&0x7F) << shift 559 if b < 0x80 { 560 break 561 } 562 } 563 intStringLen := int(stringLen) 564 if intStringLen < 0 { 565 return ErrInvalidLengthEvents 566 } 567 postIndex := iNdEx + intStringLen 568 if postIndex < 0 { 569 return ErrInvalidLengthEvents 570 } 571 if postIndex > l { 572 return io.ErrUnexpectedEOF 573 } 574 m.Namespace = string(dAtA[iNdEx:postIndex]) 575 iNdEx = postIndex 576 case 3: 577 if wireType != 2 { 578 return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) 579 } 580 var stringLen uint64 581 for shift := uint(0); ; shift += 7 { 582 if shift >= 64 { 583 return ErrIntOverflowEvents 584 } 585 if iNdEx >= l { 586 return io.ErrUnexpectedEOF 587 } 588 b := dAtA[iNdEx] 589 iNdEx++ 590 stringLen |= uint64(b&0x7F) << shift 591 if b < 0x80 { 592 break 593 } 594 } 595 intStringLen := int(stringLen) 596 if intStringLen < 0 { 597 return ErrInvalidLengthEvents 598 } 599 postIndex := iNdEx + intStringLen 600 if postIndex < 0 { 601 return ErrInvalidLengthEvents 602 } 603 if postIndex > l { 604 return io.ErrUnexpectedEOF 605 } 606 m.Topic = string(dAtA[iNdEx:postIndex]) 607 iNdEx = postIndex 608 case 4: 609 if wireType != 2 { 610 return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) 611 } 612 var msglen int 613 for shift := uint(0); ; shift += 7 { 614 if shift >= 64 { 615 return ErrIntOverflowEvents 616 } 617 if iNdEx >= l { 618 return io.ErrUnexpectedEOF 619 } 620 b := dAtA[iNdEx] 621 iNdEx++ 622 msglen |= int(b&0x7F) << shift 623 if b < 0x80 { 624 break 625 } 626 } 627 if msglen < 0 { 628 return ErrInvalidLengthEvents 629 } 630 postIndex := iNdEx + msglen 631 if postIndex < 0 { 632 return ErrInvalidLengthEvents 633 } 634 if postIndex > l { 635 return io.ErrUnexpectedEOF 636 } 637 if m.Event == nil { 638 m.Event = &types.Any{} 639 } 640 if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 641 return err 642 } 643 iNdEx = postIndex 644 default: 645 iNdEx = preIndex 646 skippy, err := skipEvents(dAtA[iNdEx:]) 647 if err != nil { 648 return err 649 } 650 if skippy < 0 { 651 return ErrInvalidLengthEvents 652 } 653 if (iNdEx + skippy) < 0 { 654 return ErrInvalidLengthEvents 655 } 656 if (iNdEx + skippy) > l { 657 return io.ErrUnexpectedEOF 658 } 659 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 660 iNdEx += skippy 661 } 662 } 663 664 if iNdEx > l { 665 return io.ErrUnexpectedEOF 666 } 667 return nil 668 } 669 func skipEvents(dAtA []byte) (n int, err error) { 670 l := len(dAtA) 671 iNdEx := 0 672 for iNdEx < l { 673 var wire uint64 674 for shift := uint(0); ; shift += 7 { 675 if shift >= 64 { 676 return 0, ErrIntOverflowEvents 677 } 678 if iNdEx >= l { 679 return 0, io.ErrUnexpectedEOF 680 } 681 b := dAtA[iNdEx] 682 iNdEx++ 683 wire |= (uint64(b) & 0x7F) << shift 684 if b < 0x80 { 685 break 686 } 687 } 688 wireType := int(wire & 0x7) 689 switch wireType { 690 case 0: 691 for shift := uint(0); ; shift += 7 { 692 if shift >= 64 { 693 return 0, ErrIntOverflowEvents 694 } 695 if iNdEx >= l { 696 return 0, io.ErrUnexpectedEOF 697 } 698 iNdEx++ 699 if dAtA[iNdEx-1] < 0x80 { 700 break 701 } 702 } 703 return iNdEx, nil 704 case 1: 705 iNdEx += 8 706 return iNdEx, nil 707 case 2: 708 var length int 709 for shift := uint(0); ; shift += 7 { 710 if shift >= 64 { 711 return 0, ErrIntOverflowEvents 712 } 713 if iNdEx >= l { 714 return 0, io.ErrUnexpectedEOF 715 } 716 b := dAtA[iNdEx] 717 iNdEx++ 718 length |= (int(b) & 0x7F) << shift 719 if b < 0x80 { 720 break 721 } 722 } 723 if length < 0 { 724 return 0, ErrInvalidLengthEvents 725 } 726 iNdEx += length 727 if iNdEx < 0 { 728 return 0, ErrInvalidLengthEvents 729 } 730 return iNdEx, nil 731 case 3: 732 for { 733 var innerWire uint64 734 var start int = iNdEx 735 for shift := uint(0); ; shift += 7 { 736 if shift >= 64 { 737 return 0, ErrIntOverflowEvents 738 } 739 if iNdEx >= l { 740 return 0, io.ErrUnexpectedEOF 741 } 742 b := dAtA[iNdEx] 743 iNdEx++ 744 innerWire |= (uint64(b) & 0x7F) << shift 745 if b < 0x80 { 746 break 747 } 748 } 749 innerWireType := int(innerWire & 0x7) 750 if innerWireType == 4 { 751 break 752 } 753 next, err := skipEvents(dAtA[start:]) 754 if err != nil { 755 return 0, err 756 } 757 iNdEx = start + next 758 if iNdEx < 0 { 759 return 0, ErrInvalidLengthEvents 760 } 761 } 762 return iNdEx, nil 763 case 4: 764 return iNdEx, nil 765 case 5: 766 iNdEx += 4 767 return iNdEx, nil 768 default: 769 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 770 } 771 } 772 panic("unreachable") 773 } 774 775 var ( 776 ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") 777 ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") 778 )