github.com/google/cadvisor@v0.49.1/third_party/containerd/api/services/events/v1/events.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: github.com/containerd/containerd/api/services/events/v1/events.proto 3 4 package events 5 6 import ( 7 context "context" 8 fmt "fmt" 9 github_com_containerd_typeurl "github.com/containerd/typeurl" 10 proto "github.com/gogo/protobuf/proto" 11 github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" 12 types "github.com/gogo/protobuf/types" 13 grpc "google.golang.org/grpc" 14 codes "google.golang.org/grpc/codes" 15 status "google.golang.org/grpc/status" 16 io "io" 17 math "math" 18 math_bits "math/bits" 19 reflect "reflect" 20 strings "strings" 21 time "time" 22 ) 23 24 // Reference imports to suppress errors if they are not otherwise used. 25 var _ = proto.Marshal 26 var _ = fmt.Errorf 27 var _ = math.Inf 28 var _ = time.Kitchen 29 30 // This is a compile-time assertion to ensure that this generated file 31 // is compatible with the proto package it is being compiled against. 32 // A compilation error at this line likely means your copy of the 33 // proto package needs to be updated. 34 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 35 36 type PublishRequest struct { 37 Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` 38 Event *types.Any `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"` 39 XXX_NoUnkeyedLiteral struct{} `json:"-"` 40 XXX_unrecognized []byte `json:"-"` 41 XXX_sizecache int32 `json:"-"` 42 } 43 44 func (m *PublishRequest) Reset() { *m = PublishRequest{} } 45 func (*PublishRequest) ProtoMessage() {} 46 func (*PublishRequest) Descriptor() ([]byte, []int) { 47 return fileDescriptor_43fcd20dc1642376, []int{0} 48 } 49 func (m *PublishRequest) XXX_Unmarshal(b []byte) error { 50 return m.Unmarshal(b) 51 } 52 func (m *PublishRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 53 if deterministic { 54 return xxx_messageInfo_PublishRequest.Marshal(b, m, deterministic) 55 } else { 56 b = b[:cap(b)] 57 n, err := m.MarshalToSizedBuffer(b) 58 if err != nil { 59 return nil, err 60 } 61 return b[:n], nil 62 } 63 } 64 func (m *PublishRequest) XXX_Merge(src proto.Message) { 65 xxx_messageInfo_PublishRequest.Merge(m, src) 66 } 67 func (m *PublishRequest) XXX_Size() int { 68 return m.Size() 69 } 70 func (m *PublishRequest) XXX_DiscardUnknown() { 71 xxx_messageInfo_PublishRequest.DiscardUnknown(m) 72 } 73 74 var xxx_messageInfo_PublishRequest proto.InternalMessageInfo 75 76 type ForwardRequest struct { 77 Envelope *Envelope `protobuf:"bytes,1,opt,name=envelope,proto3" json:"envelope,omitempty"` 78 XXX_NoUnkeyedLiteral struct{} `json:"-"` 79 XXX_unrecognized []byte `json:"-"` 80 XXX_sizecache int32 `json:"-"` 81 } 82 83 func (m *ForwardRequest) Reset() { *m = ForwardRequest{} } 84 func (*ForwardRequest) ProtoMessage() {} 85 func (*ForwardRequest) Descriptor() ([]byte, []int) { 86 return fileDescriptor_43fcd20dc1642376, []int{1} 87 } 88 func (m *ForwardRequest) XXX_Unmarshal(b []byte) error { 89 return m.Unmarshal(b) 90 } 91 func (m *ForwardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 92 if deterministic { 93 return xxx_messageInfo_ForwardRequest.Marshal(b, m, deterministic) 94 } else { 95 b = b[:cap(b)] 96 n, err := m.MarshalToSizedBuffer(b) 97 if err != nil { 98 return nil, err 99 } 100 return b[:n], nil 101 } 102 } 103 func (m *ForwardRequest) XXX_Merge(src proto.Message) { 104 xxx_messageInfo_ForwardRequest.Merge(m, src) 105 } 106 func (m *ForwardRequest) XXX_Size() int { 107 return m.Size() 108 } 109 func (m *ForwardRequest) XXX_DiscardUnknown() { 110 xxx_messageInfo_ForwardRequest.DiscardUnknown(m) 111 } 112 113 var xxx_messageInfo_ForwardRequest proto.InternalMessageInfo 114 115 type SubscribeRequest struct { 116 Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` 117 XXX_NoUnkeyedLiteral struct{} `json:"-"` 118 XXX_unrecognized []byte `json:"-"` 119 XXX_sizecache int32 `json:"-"` 120 } 121 122 func (m *SubscribeRequest) Reset() { *m = SubscribeRequest{} } 123 func (*SubscribeRequest) ProtoMessage() {} 124 func (*SubscribeRequest) Descriptor() ([]byte, []int) { 125 return fileDescriptor_43fcd20dc1642376, []int{2} 126 } 127 func (m *SubscribeRequest) XXX_Unmarshal(b []byte) error { 128 return m.Unmarshal(b) 129 } 130 func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 131 if deterministic { 132 return xxx_messageInfo_SubscribeRequest.Marshal(b, m, deterministic) 133 } else { 134 b = b[:cap(b)] 135 n, err := m.MarshalToSizedBuffer(b) 136 if err != nil { 137 return nil, err 138 } 139 return b[:n], nil 140 } 141 } 142 func (m *SubscribeRequest) XXX_Merge(src proto.Message) { 143 xxx_messageInfo_SubscribeRequest.Merge(m, src) 144 } 145 func (m *SubscribeRequest) XXX_Size() int { 146 return m.Size() 147 } 148 func (m *SubscribeRequest) XXX_DiscardUnknown() { 149 xxx_messageInfo_SubscribeRequest.DiscardUnknown(m) 150 } 151 152 var xxx_messageInfo_SubscribeRequest proto.InternalMessageInfo 153 154 type Envelope struct { 155 Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"` 156 Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` 157 Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` 158 Event *types.Any `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"` 159 XXX_NoUnkeyedLiteral struct{} `json:"-"` 160 XXX_unrecognized []byte `json:"-"` 161 XXX_sizecache int32 `json:"-"` 162 } 163 164 func (m *Envelope) Reset() { *m = Envelope{} } 165 func (*Envelope) ProtoMessage() {} 166 func (*Envelope) Descriptor() ([]byte, []int) { 167 return fileDescriptor_43fcd20dc1642376, []int{3} 168 } 169 func (m *Envelope) XXX_Unmarshal(b []byte) error { 170 return m.Unmarshal(b) 171 } 172 func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 173 if deterministic { 174 return xxx_messageInfo_Envelope.Marshal(b, m, deterministic) 175 } else { 176 b = b[:cap(b)] 177 n, err := m.MarshalToSizedBuffer(b) 178 if err != nil { 179 return nil, err 180 } 181 return b[:n], nil 182 } 183 } 184 func (m *Envelope) XXX_Merge(src proto.Message) { 185 xxx_messageInfo_Envelope.Merge(m, src) 186 } 187 func (m *Envelope) XXX_Size() int { 188 return m.Size() 189 } 190 func (m *Envelope) XXX_DiscardUnknown() { 191 xxx_messageInfo_Envelope.DiscardUnknown(m) 192 } 193 194 var xxx_messageInfo_Envelope proto.InternalMessageInfo 195 196 func init() { 197 proto.RegisterType((*PublishRequest)(nil), "containerd.services.events.v1.PublishRequest") 198 proto.RegisterType((*ForwardRequest)(nil), "containerd.services.events.v1.ForwardRequest") 199 proto.RegisterType((*SubscribeRequest)(nil), "containerd.services.events.v1.SubscribeRequest") 200 proto.RegisterType((*Envelope)(nil), "containerd.services.events.v1.Envelope") 201 } 202 203 func init() { 204 proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/events.proto", fileDescriptor_43fcd20dc1642376) 205 } 206 207 var fileDescriptor_43fcd20dc1642376 = []byte{ 208 // 466 bytes of a gzipped FileDescriptorProto 209 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xcd, 0x8e, 0xd3, 0x30, 210 0x14, 0x85, 0xeb, 0xf9, 0x6d, 0x3c, 0xd2, 0x08, 0x45, 0x15, 0x2a, 0x01, 0xd2, 0xaa, 0x1b, 0x2a, 211 0x04, 0x0e, 0x53, 0x76, 0x20, 0x21, 0x28, 0x94, 0xf5, 0x28, 0x80, 0x54, 0xb1, 0x4b, 0xd2, 0xdb, 212 0xd4, 0x52, 0x62, 0x9b, 0xd8, 0x09, 0x9a, 0xdd, 0x3c, 0x02, 0x1b, 0xde, 0x84, 0x0d, 0x6f, 0xd0, 213 0x25, 0x4b, 0x56, 0xc0, 0xf4, 0x49, 0x50, 0x13, 0xbb, 0x61, 0x3a, 0x40, 0x10, 0xbb, 0x6b, 0xdf, 214 0xe3, 0xcf, 0xb9, 0xe7, 0x38, 0xf8, 0x45, 0x4c, 0xd5, 0x22, 0x0f, 0x49, 0xc4, 0x53, 0x2f, 0xe2, 215 0x4c, 0x05, 0x94, 0x41, 0x36, 0xfb, 0xb5, 0x0c, 0x04, 0xf5, 0x24, 0x64, 0x05, 0x8d, 0x40, 0x7a, 216 0x50, 0x00, 0x53, 0xd2, 0x2b, 0x4e, 0x74, 0x45, 0x44, 0xc6, 0x15, 0xb7, 0x6f, 0xd7, 0x7a, 0x62, 217 0xb4, 0x44, 0x2b, 0x8a, 0x13, 0xe7, 0x69, 0xe3, 0x25, 0x25, 0x26, 0xcc, 0xe7, 0x9e, 0x48, 0xf2, 218 0x98, 0x32, 0x6f, 0x4e, 0x21, 0x99, 0x89, 0x40, 0x2d, 0xaa, 0x0b, 0x9c, 0x4e, 0xcc, 0x63, 0x5e, 219 0x96, 0xde, 0xba, 0xd2, 0xbb, 0x37, 0x62, 0xce, 0xe3, 0x04, 0xea, 0xd3, 0x01, 0x3b, 0xd3, 0xad, 220 0x9b, 0xdb, 0x2d, 0x48, 0x85, 0x32, 0xcd, 0xde, 0x76, 0x53, 0xd1, 0x14, 0xa4, 0x0a, 0x52, 0x51, 221 0x09, 0x06, 0x3e, 0x3e, 0x3e, 0xcd, 0xc3, 0x84, 0xca, 0x85, 0x0f, 0xef, 0x72, 0x90, 0xca, 0xee, 222 0xe0, 0x7d, 0xc5, 0x05, 0x8d, 0xba, 0xa8, 0x8f, 0x86, 0x96, 0x5f, 0x2d, 0xec, 0xbb, 0x78, 0xbf, 223 0x9c, 0xb2, 0xbb, 0xd3, 0x47, 0xc3, 0xa3, 0x51, 0x87, 0x54, 0x60, 0x62, 0xc0, 0xe4, 0x19, 0x3b, 224 0xf3, 0x2b, 0xc9, 0xe0, 0x0d, 0x3e, 0x7e, 0xc9, 0xb3, 0xf7, 0x41, 0x36, 0x33, 0xcc, 0xe7, 0xb8, 225 0x0d, 0xac, 0x80, 0x84, 0x0b, 0x28, 0xb1, 0x47, 0xa3, 0x3b, 0xe4, 0xaf, 0x46, 0x92, 0x89, 0x96, 226 0xfb, 0x9b, 0x83, 0x83, 0x7b, 0xf8, 0xda, 0xab, 0x3c, 0x94, 0x51, 0x46, 0x43, 0x30, 0xe0, 0x2e, 227 0x3e, 0x9c, 0xd3, 0x44, 0x41, 0x26, 0xbb, 0xa8, 0xbf, 0x3b, 0xb4, 0x7c, 0xb3, 0x1c, 0x7c, 0x42, 228 0xb8, 0x6d, 0x20, 0xf6, 0x18, 0x5b, 0x9b, 0xc1, 0xf5, 0x07, 0x38, 0x57, 0x26, 0x78, 0x6d, 0x14, 229 0xe3, 0xf6, 0xf2, 0x5b, 0xaf, 0xf5, 0xe1, 0x7b, 0x0f, 0xf9, 0xf5, 0x31, 0xfb, 0x16, 0xb6, 0x58, 230 0x90, 0x82, 0x14, 0x41, 0x04, 0xa5, 0x0b, 0x96, 0x5f, 0x6f, 0xd4, 0xae, 0xed, 0xfe, 0xd6, 0xb5, 231 0xbd, 0x46, 0xd7, 0x1e, 0xed, 0x9d, 0x7f, 0xee, 0xa1, 0xd1, 0xc7, 0x1d, 0x7c, 0x30, 0x29, 0x5d, 232 0xb0, 0x4f, 0xf1, 0xa1, 0x8e, 0xc6, 0xbe, 0xdf, 0xe0, 0xd6, 0xe5, 0x08, 0x9d, 0xeb, 0x57, 0xee, 233 0x99, 0xac, 0xdf, 0xc4, 0x9a, 0xa8, 0x83, 0x69, 0x24, 0x5e, 0x0e, 0xf0, 0x8f, 0xc4, 0x18, 0x5b, 234 0x9b, 0x4c, 0x6c, 0xaf, 0x81, 0xb9, 0x9d, 0x9e, 0xf3, 0xaf, 0x8f, 0xe0, 0x01, 0x1a, 0x4f, 0x97, 235 0x17, 0x6e, 0xeb, 0xeb, 0x85, 0xdb, 0x3a, 0x5f, 0xb9, 0x68, 0xb9, 0x72, 0xd1, 0x97, 0x95, 0x8b, 236 0x7e, 0xac, 0x5c, 0xf4, 0xf6, 0xc9, 0x7f, 0xfe, 0xd7, 0x8f, 0xab, 0x6a, 0xda, 0x9a, 0xa2, 0xf0, 237 0xa0, 0x1c, 0xeb, 0xe1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xbf, 0x19, 0xa6, 0x24, 0x04, 238 0x00, 0x00, 239 } 240 241 // Field returns the value for the given fieldpath as a string, if defined. 242 // If the value is not defined, the second value will be false. 243 func (m *Envelope) Field(fieldpath []string) (string, bool) { 244 if len(fieldpath) == 0 { 245 return "", false 246 } 247 248 switch fieldpath[0] { 249 // unhandled: timestamp 250 case "namespace": 251 return string(m.Namespace), len(m.Namespace) > 0 252 case "topic": 253 return string(m.Topic), len(m.Topic) > 0 254 case "event": 255 decoded, err := github_com_containerd_typeurl.UnmarshalAny(m.Event) 256 if err != nil { 257 return "", false 258 } 259 260 adaptor, ok := decoded.(interface{ Field([]string) (string, bool) }) 261 if !ok { 262 return "", false 263 } 264 return adaptor.Field(fieldpath[1:]) 265 } 266 return "", false 267 } 268 269 // Reference imports to suppress errors if they are not otherwise used. 270 var _ context.Context 271 var _ grpc.ClientConn 272 273 // This is a compile-time assertion to ensure that this generated file 274 // is compatible with the grpc package it is being compiled against. 275 const _ = grpc.SupportPackageIsVersion4 276 277 // EventsClient is the client API for Events service. 278 // 279 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 280 type EventsClient interface { 281 // Publish an event to a topic. 282 // 283 // The event will be packed into a timestamp envelope with the namespace 284 // introspected from the context. The envelope will then be dispatched. 285 Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*types.Empty, error) 286 // Forward sends an event that has already been packaged into an envelope 287 // with a timestamp and namespace. 288 // 289 // This is useful if earlier timestamping is required or when forwarding on 290 // behalf of another component, namespace or publisher. 291 Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*types.Empty, error) 292 // Subscribe to a stream of events, possibly returning only that match any 293 // of the provided filters. 294 // 295 // Unlike many other methods in containerd, subscribers will get messages 296 // from all namespaces unless otherwise specified. If this is not desired, 297 // a filter can be provided in the format 'namespace==<namespace>' to 298 // restrict the received events. 299 Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Events_SubscribeClient, error) 300 } 301 302 type eventsClient struct { 303 cc *grpc.ClientConn 304 } 305 306 func NewEventsClient(cc *grpc.ClientConn) EventsClient { 307 return &eventsClient{cc} 308 } 309 310 func (c *eventsClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*types.Empty, error) { 311 out := new(types.Empty) 312 err := c.cc.Invoke(ctx, "/containerd.services.events.v1.Events/Publish", in, out, opts...) 313 if err != nil { 314 return nil, err 315 } 316 return out, nil 317 } 318 319 func (c *eventsClient) Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*types.Empty, error) { 320 out := new(types.Empty) 321 err := c.cc.Invoke(ctx, "/containerd.services.events.v1.Events/Forward", in, out, opts...) 322 if err != nil { 323 return nil, err 324 } 325 return out, nil 326 } 327 328 func (c *eventsClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Events_SubscribeClient, error) { 329 stream, err := c.cc.NewStream(ctx, &_Events_serviceDesc.Streams[0], "/containerd.services.events.v1.Events/Subscribe", opts...) 330 if err != nil { 331 return nil, err 332 } 333 x := &eventsSubscribeClient{stream} 334 if err := x.ClientStream.SendMsg(in); err != nil { 335 return nil, err 336 } 337 if err := x.ClientStream.CloseSend(); err != nil { 338 return nil, err 339 } 340 return x, nil 341 } 342 343 type Events_SubscribeClient interface { 344 Recv() (*Envelope, error) 345 grpc.ClientStream 346 } 347 348 type eventsSubscribeClient struct { 349 grpc.ClientStream 350 } 351 352 func (x *eventsSubscribeClient) Recv() (*Envelope, error) { 353 m := new(Envelope) 354 if err := x.ClientStream.RecvMsg(m); err != nil { 355 return nil, err 356 } 357 return m, nil 358 } 359 360 // EventsServer is the server API for Events service. 361 type EventsServer interface { 362 // Publish an event to a topic. 363 // 364 // The event will be packed into a timestamp envelope with the namespace 365 // introspected from the context. The envelope will then be dispatched. 366 Publish(context.Context, *PublishRequest) (*types.Empty, error) 367 // Forward sends an event that has already been packaged into an envelope 368 // with a timestamp and namespace. 369 // 370 // This is useful if earlier timestamping is required or when forwarding on 371 // behalf of another component, namespace or publisher. 372 Forward(context.Context, *ForwardRequest) (*types.Empty, error) 373 // Subscribe to a stream of events, possibly returning only that match any 374 // of the provided filters. 375 // 376 // Unlike many other methods in containerd, subscribers will get messages 377 // from all namespaces unless otherwise specified. If this is not desired, 378 // a filter can be provided in the format 'namespace==<namespace>' to 379 // restrict the received events. 380 Subscribe(*SubscribeRequest, Events_SubscribeServer) error 381 } 382 383 // UnimplementedEventsServer can be embedded to have forward compatible implementations. 384 type UnimplementedEventsServer struct { 385 } 386 387 func (*UnimplementedEventsServer) Publish(ctx context.Context, req *PublishRequest) (*types.Empty, error) { 388 return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented") 389 } 390 func (*UnimplementedEventsServer) Forward(ctx context.Context, req *ForwardRequest) (*types.Empty, error) { 391 return nil, status.Errorf(codes.Unimplemented, "method Forward not implemented") 392 } 393 func (*UnimplementedEventsServer) Subscribe(req *SubscribeRequest, srv Events_SubscribeServer) error { 394 return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") 395 } 396 397 func RegisterEventsServer(s *grpc.Server, srv EventsServer) { 398 s.RegisterService(&_Events_serviceDesc, srv) 399 } 400 401 func _Events_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 402 in := new(PublishRequest) 403 if err := dec(in); err != nil { 404 return nil, err 405 } 406 if interceptor == nil { 407 return srv.(EventsServer).Publish(ctx, in) 408 } 409 info := &grpc.UnaryServerInfo{ 410 Server: srv, 411 FullMethod: "/containerd.services.events.v1.Events/Publish", 412 } 413 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 414 return srv.(EventsServer).Publish(ctx, req.(*PublishRequest)) 415 } 416 return interceptor(ctx, in, info, handler) 417 } 418 419 func _Events_Forward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 420 in := new(ForwardRequest) 421 if err := dec(in); err != nil { 422 return nil, err 423 } 424 if interceptor == nil { 425 return srv.(EventsServer).Forward(ctx, in) 426 } 427 info := &grpc.UnaryServerInfo{ 428 Server: srv, 429 FullMethod: "/containerd.services.events.v1.Events/Forward", 430 } 431 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 432 return srv.(EventsServer).Forward(ctx, req.(*ForwardRequest)) 433 } 434 return interceptor(ctx, in, info, handler) 435 } 436 437 func _Events_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { 438 m := new(SubscribeRequest) 439 if err := stream.RecvMsg(m); err != nil { 440 return err 441 } 442 return srv.(EventsServer).Subscribe(m, &eventsSubscribeServer{stream}) 443 } 444 445 type Events_SubscribeServer interface { 446 Send(*Envelope) error 447 grpc.ServerStream 448 } 449 450 type eventsSubscribeServer struct { 451 grpc.ServerStream 452 } 453 454 func (x *eventsSubscribeServer) Send(m *Envelope) error { 455 return x.ServerStream.SendMsg(m) 456 } 457 458 var _Events_serviceDesc = grpc.ServiceDesc{ 459 ServiceName: "containerd.services.events.v1.Events", 460 HandlerType: (*EventsServer)(nil), 461 Methods: []grpc.MethodDesc{ 462 { 463 MethodName: "Publish", 464 Handler: _Events_Publish_Handler, 465 }, 466 { 467 MethodName: "Forward", 468 Handler: _Events_Forward_Handler, 469 }, 470 }, 471 Streams: []grpc.StreamDesc{ 472 { 473 StreamName: "Subscribe", 474 Handler: _Events_Subscribe_Handler, 475 ServerStreams: true, 476 }, 477 }, 478 Metadata: "github.com/containerd/containerd/api/services/events/v1/events.proto", 479 } 480 481 func (m *PublishRequest) Marshal() (dAtA []byte, err error) { 482 size := m.Size() 483 dAtA = make([]byte, size) 484 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 485 if err != nil { 486 return nil, err 487 } 488 return dAtA[:n], nil 489 } 490 491 func (m *PublishRequest) MarshalTo(dAtA []byte) (int, error) { 492 size := m.Size() 493 return m.MarshalToSizedBuffer(dAtA[:size]) 494 } 495 496 func (m *PublishRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 497 i := len(dAtA) 498 _ = i 499 var l int 500 _ = l 501 if m.XXX_unrecognized != nil { 502 i -= len(m.XXX_unrecognized) 503 copy(dAtA[i:], m.XXX_unrecognized) 504 } 505 if m.Event != nil { 506 { 507 size, err := m.Event.MarshalToSizedBuffer(dAtA[:i]) 508 if err != nil { 509 return 0, err 510 } 511 i -= size 512 i = encodeVarintEvents(dAtA, i, uint64(size)) 513 } 514 i-- 515 dAtA[i] = 0x12 516 } 517 if len(m.Topic) > 0 { 518 i -= len(m.Topic) 519 copy(dAtA[i:], m.Topic) 520 i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic))) 521 i-- 522 dAtA[i] = 0xa 523 } 524 return len(dAtA) - i, nil 525 } 526 527 func (m *ForwardRequest) Marshal() (dAtA []byte, err error) { 528 size := m.Size() 529 dAtA = make([]byte, size) 530 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 531 if err != nil { 532 return nil, err 533 } 534 return dAtA[:n], nil 535 } 536 537 func (m *ForwardRequest) MarshalTo(dAtA []byte) (int, error) { 538 size := m.Size() 539 return m.MarshalToSizedBuffer(dAtA[:size]) 540 } 541 542 func (m *ForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 543 i := len(dAtA) 544 _ = i 545 var l int 546 _ = l 547 if m.XXX_unrecognized != nil { 548 i -= len(m.XXX_unrecognized) 549 copy(dAtA[i:], m.XXX_unrecognized) 550 } 551 if m.Envelope != nil { 552 { 553 size, err := m.Envelope.MarshalToSizedBuffer(dAtA[:i]) 554 if err != nil { 555 return 0, err 556 } 557 i -= size 558 i = encodeVarintEvents(dAtA, i, uint64(size)) 559 } 560 i-- 561 dAtA[i] = 0xa 562 } 563 return len(dAtA) - i, nil 564 } 565 566 func (m *SubscribeRequest) Marshal() (dAtA []byte, err error) { 567 size := m.Size() 568 dAtA = make([]byte, size) 569 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 570 if err != nil { 571 return nil, err 572 } 573 return dAtA[:n], nil 574 } 575 576 func (m *SubscribeRequest) MarshalTo(dAtA []byte) (int, error) { 577 size := m.Size() 578 return m.MarshalToSizedBuffer(dAtA[:size]) 579 } 580 581 func (m *SubscribeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 582 i := len(dAtA) 583 _ = i 584 var l int 585 _ = l 586 if m.XXX_unrecognized != nil { 587 i -= len(m.XXX_unrecognized) 588 copy(dAtA[i:], m.XXX_unrecognized) 589 } 590 if len(m.Filters) > 0 { 591 for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- { 592 i -= len(m.Filters[iNdEx]) 593 copy(dAtA[i:], m.Filters[iNdEx]) 594 i = encodeVarintEvents(dAtA, i, uint64(len(m.Filters[iNdEx]))) 595 i-- 596 dAtA[i] = 0xa 597 } 598 } 599 return len(dAtA) - i, nil 600 } 601 602 func (m *Envelope) Marshal() (dAtA []byte, err error) { 603 size := m.Size() 604 dAtA = make([]byte, size) 605 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 606 if err != nil { 607 return nil, err 608 } 609 return dAtA[:n], nil 610 } 611 612 func (m *Envelope) MarshalTo(dAtA []byte) (int, error) { 613 size := m.Size() 614 return m.MarshalToSizedBuffer(dAtA[:size]) 615 } 616 617 func (m *Envelope) MarshalToSizedBuffer(dAtA []byte) (int, error) { 618 i := len(dAtA) 619 _ = i 620 var l int 621 _ = l 622 if m.XXX_unrecognized != nil { 623 i -= len(m.XXX_unrecognized) 624 copy(dAtA[i:], m.XXX_unrecognized) 625 } 626 if m.Event != nil { 627 { 628 size, err := m.Event.MarshalToSizedBuffer(dAtA[:i]) 629 if err != nil { 630 return 0, err 631 } 632 i -= size 633 i = encodeVarintEvents(dAtA, i, uint64(size)) 634 } 635 i-- 636 dAtA[i] = 0x22 637 } 638 if len(m.Topic) > 0 { 639 i -= len(m.Topic) 640 copy(dAtA[i:], m.Topic) 641 i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic))) 642 i-- 643 dAtA[i] = 0x1a 644 } 645 if len(m.Namespace) > 0 { 646 i -= len(m.Namespace) 647 copy(dAtA[i:], m.Namespace) 648 i = encodeVarintEvents(dAtA, i, uint64(len(m.Namespace))) 649 i-- 650 dAtA[i] = 0x12 651 } 652 n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) 653 if err4 != nil { 654 return 0, err4 655 } 656 i -= n4 657 i = encodeVarintEvents(dAtA, i, uint64(n4)) 658 i-- 659 dAtA[i] = 0xa 660 return len(dAtA) - i, nil 661 } 662 663 func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { 664 offset -= sovEvents(v) 665 base := offset 666 for v >= 1<<7 { 667 dAtA[offset] = uint8(v&0x7f | 0x80) 668 v >>= 7 669 offset++ 670 } 671 dAtA[offset] = uint8(v) 672 return base 673 } 674 func (m *PublishRequest) Size() (n int) { 675 if m == nil { 676 return 0 677 } 678 var l int 679 _ = l 680 l = len(m.Topic) 681 if l > 0 { 682 n += 1 + l + sovEvents(uint64(l)) 683 } 684 if m.Event != nil { 685 l = m.Event.Size() 686 n += 1 + l + sovEvents(uint64(l)) 687 } 688 if m.XXX_unrecognized != nil { 689 n += len(m.XXX_unrecognized) 690 } 691 return n 692 } 693 694 func (m *ForwardRequest) Size() (n int) { 695 if m == nil { 696 return 0 697 } 698 var l int 699 _ = l 700 if m.Envelope != nil { 701 l = m.Envelope.Size() 702 n += 1 + l + sovEvents(uint64(l)) 703 } 704 if m.XXX_unrecognized != nil { 705 n += len(m.XXX_unrecognized) 706 } 707 return n 708 } 709 710 func (m *SubscribeRequest) Size() (n int) { 711 if m == nil { 712 return 0 713 } 714 var l int 715 _ = l 716 if len(m.Filters) > 0 { 717 for _, s := range m.Filters { 718 l = len(s) 719 n += 1 + l + sovEvents(uint64(l)) 720 } 721 } 722 if m.XXX_unrecognized != nil { 723 n += len(m.XXX_unrecognized) 724 } 725 return n 726 } 727 728 func (m *Envelope) Size() (n int) { 729 if m == nil { 730 return 0 731 } 732 var l int 733 _ = l 734 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) 735 n += 1 + l + sovEvents(uint64(l)) 736 l = len(m.Namespace) 737 if l > 0 { 738 n += 1 + l + sovEvents(uint64(l)) 739 } 740 l = len(m.Topic) 741 if l > 0 { 742 n += 1 + l + sovEvents(uint64(l)) 743 } 744 if m.Event != nil { 745 l = m.Event.Size() 746 n += 1 + l + sovEvents(uint64(l)) 747 } 748 if m.XXX_unrecognized != nil { 749 n += len(m.XXX_unrecognized) 750 } 751 return n 752 } 753 754 func sovEvents(x uint64) (n int) { 755 return (math_bits.Len64(x|1) + 6) / 7 756 } 757 func sozEvents(x uint64) (n int) { 758 return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 759 } 760 func (this *PublishRequest) String() string { 761 if this == nil { 762 return "nil" 763 } 764 s := strings.Join([]string{`&PublishRequest{`, 765 `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, 766 `Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "types.Any", 1) + `,`, 767 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 768 `}`, 769 }, "") 770 return s 771 } 772 func (this *ForwardRequest) String() string { 773 if this == nil { 774 return "nil" 775 } 776 s := strings.Join([]string{`&ForwardRequest{`, 777 `Envelope:` + strings.Replace(this.Envelope.String(), "Envelope", "Envelope", 1) + `,`, 778 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 779 `}`, 780 }, "") 781 return s 782 } 783 func (this *SubscribeRequest) String() string { 784 if this == nil { 785 return "nil" 786 } 787 s := strings.Join([]string{`&SubscribeRequest{`, 788 `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`, 789 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 790 `}`, 791 }, "") 792 return s 793 } 794 func (this *Envelope) String() string { 795 if this == nil { 796 return "nil" 797 } 798 s := strings.Join([]string{`&Envelope{`, 799 `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, 800 `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, 801 `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, 802 `Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "types.Any", 1) + `,`, 803 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 804 `}`, 805 }, "") 806 return s 807 } 808 func valueToStringEvents(v interface{}) string { 809 rv := reflect.ValueOf(v) 810 if rv.IsNil() { 811 return "nil" 812 } 813 pv := reflect.Indirect(rv).Interface() 814 return fmt.Sprintf("*%v", pv) 815 } 816 func (m *PublishRequest) Unmarshal(dAtA []byte) error { 817 l := len(dAtA) 818 iNdEx := 0 819 for iNdEx < l { 820 preIndex := iNdEx 821 var wire uint64 822 for shift := uint(0); ; shift += 7 { 823 if shift >= 64 { 824 return ErrIntOverflowEvents 825 } 826 if iNdEx >= l { 827 return io.ErrUnexpectedEOF 828 } 829 b := dAtA[iNdEx] 830 iNdEx++ 831 wire |= uint64(b&0x7F) << shift 832 if b < 0x80 { 833 break 834 } 835 } 836 fieldNum := int32(wire >> 3) 837 wireType := int(wire & 0x7) 838 if wireType == 4 { 839 return fmt.Errorf("proto: PublishRequest: wiretype end group for non-group") 840 } 841 if fieldNum <= 0 { 842 return fmt.Errorf("proto: PublishRequest: illegal tag %d (wire type %d)", fieldNum, wire) 843 } 844 switch fieldNum { 845 case 1: 846 if wireType != 2 { 847 return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) 848 } 849 var stringLen uint64 850 for shift := uint(0); ; shift += 7 { 851 if shift >= 64 { 852 return ErrIntOverflowEvents 853 } 854 if iNdEx >= l { 855 return io.ErrUnexpectedEOF 856 } 857 b := dAtA[iNdEx] 858 iNdEx++ 859 stringLen |= uint64(b&0x7F) << shift 860 if b < 0x80 { 861 break 862 } 863 } 864 intStringLen := int(stringLen) 865 if intStringLen < 0 { 866 return ErrInvalidLengthEvents 867 } 868 postIndex := iNdEx + intStringLen 869 if postIndex < 0 { 870 return ErrInvalidLengthEvents 871 } 872 if postIndex > l { 873 return io.ErrUnexpectedEOF 874 } 875 m.Topic = string(dAtA[iNdEx:postIndex]) 876 iNdEx = postIndex 877 case 2: 878 if wireType != 2 { 879 return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) 880 } 881 var msglen int 882 for shift := uint(0); ; shift += 7 { 883 if shift >= 64 { 884 return ErrIntOverflowEvents 885 } 886 if iNdEx >= l { 887 return io.ErrUnexpectedEOF 888 } 889 b := dAtA[iNdEx] 890 iNdEx++ 891 msglen |= int(b&0x7F) << shift 892 if b < 0x80 { 893 break 894 } 895 } 896 if msglen < 0 { 897 return ErrInvalidLengthEvents 898 } 899 postIndex := iNdEx + msglen 900 if postIndex < 0 { 901 return ErrInvalidLengthEvents 902 } 903 if postIndex > l { 904 return io.ErrUnexpectedEOF 905 } 906 if m.Event == nil { 907 m.Event = &types.Any{} 908 } 909 if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 910 return err 911 } 912 iNdEx = postIndex 913 default: 914 iNdEx = preIndex 915 skippy, err := skipEvents(dAtA[iNdEx:]) 916 if err != nil { 917 return err 918 } 919 if (skippy < 0) || (iNdEx+skippy) < 0 { 920 return ErrInvalidLengthEvents 921 } 922 if (iNdEx + skippy) > l { 923 return io.ErrUnexpectedEOF 924 } 925 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 926 iNdEx += skippy 927 } 928 } 929 930 if iNdEx > l { 931 return io.ErrUnexpectedEOF 932 } 933 return nil 934 } 935 func (m *ForwardRequest) Unmarshal(dAtA []byte) error { 936 l := len(dAtA) 937 iNdEx := 0 938 for iNdEx < l { 939 preIndex := iNdEx 940 var wire uint64 941 for shift := uint(0); ; shift += 7 { 942 if shift >= 64 { 943 return ErrIntOverflowEvents 944 } 945 if iNdEx >= l { 946 return io.ErrUnexpectedEOF 947 } 948 b := dAtA[iNdEx] 949 iNdEx++ 950 wire |= uint64(b&0x7F) << shift 951 if b < 0x80 { 952 break 953 } 954 } 955 fieldNum := int32(wire >> 3) 956 wireType := int(wire & 0x7) 957 if wireType == 4 { 958 return fmt.Errorf("proto: ForwardRequest: wiretype end group for non-group") 959 } 960 if fieldNum <= 0 { 961 return fmt.Errorf("proto: ForwardRequest: illegal tag %d (wire type %d)", fieldNum, wire) 962 } 963 switch fieldNum { 964 case 1: 965 if wireType != 2 { 966 return fmt.Errorf("proto: wrong wireType = %d for field Envelope", wireType) 967 } 968 var msglen int 969 for shift := uint(0); ; shift += 7 { 970 if shift >= 64 { 971 return ErrIntOverflowEvents 972 } 973 if iNdEx >= l { 974 return io.ErrUnexpectedEOF 975 } 976 b := dAtA[iNdEx] 977 iNdEx++ 978 msglen |= int(b&0x7F) << shift 979 if b < 0x80 { 980 break 981 } 982 } 983 if msglen < 0 { 984 return ErrInvalidLengthEvents 985 } 986 postIndex := iNdEx + msglen 987 if postIndex < 0 { 988 return ErrInvalidLengthEvents 989 } 990 if postIndex > l { 991 return io.ErrUnexpectedEOF 992 } 993 if m.Envelope == nil { 994 m.Envelope = &Envelope{} 995 } 996 if err := m.Envelope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 997 return err 998 } 999 iNdEx = postIndex 1000 default: 1001 iNdEx = preIndex 1002 skippy, err := skipEvents(dAtA[iNdEx:]) 1003 if err != nil { 1004 return err 1005 } 1006 if (skippy < 0) || (iNdEx+skippy) < 0 { 1007 return ErrInvalidLengthEvents 1008 } 1009 if (iNdEx + skippy) > l { 1010 return io.ErrUnexpectedEOF 1011 } 1012 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1013 iNdEx += skippy 1014 } 1015 } 1016 1017 if iNdEx > l { 1018 return io.ErrUnexpectedEOF 1019 } 1020 return nil 1021 } 1022 func (m *SubscribeRequest) Unmarshal(dAtA []byte) error { 1023 l := len(dAtA) 1024 iNdEx := 0 1025 for iNdEx < l { 1026 preIndex := iNdEx 1027 var wire uint64 1028 for shift := uint(0); ; shift += 7 { 1029 if shift >= 64 { 1030 return ErrIntOverflowEvents 1031 } 1032 if iNdEx >= l { 1033 return io.ErrUnexpectedEOF 1034 } 1035 b := dAtA[iNdEx] 1036 iNdEx++ 1037 wire |= uint64(b&0x7F) << shift 1038 if b < 0x80 { 1039 break 1040 } 1041 } 1042 fieldNum := int32(wire >> 3) 1043 wireType := int(wire & 0x7) 1044 if wireType == 4 { 1045 return fmt.Errorf("proto: SubscribeRequest: wiretype end group for non-group") 1046 } 1047 if fieldNum <= 0 { 1048 return fmt.Errorf("proto: SubscribeRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1049 } 1050 switch fieldNum { 1051 case 1: 1052 if wireType != 2 { 1053 return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) 1054 } 1055 var stringLen uint64 1056 for shift := uint(0); ; shift += 7 { 1057 if shift >= 64 { 1058 return ErrIntOverflowEvents 1059 } 1060 if iNdEx >= l { 1061 return io.ErrUnexpectedEOF 1062 } 1063 b := dAtA[iNdEx] 1064 iNdEx++ 1065 stringLen |= uint64(b&0x7F) << shift 1066 if b < 0x80 { 1067 break 1068 } 1069 } 1070 intStringLen := int(stringLen) 1071 if intStringLen < 0 { 1072 return ErrInvalidLengthEvents 1073 } 1074 postIndex := iNdEx + intStringLen 1075 if postIndex < 0 { 1076 return ErrInvalidLengthEvents 1077 } 1078 if postIndex > l { 1079 return io.ErrUnexpectedEOF 1080 } 1081 m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex])) 1082 iNdEx = postIndex 1083 default: 1084 iNdEx = preIndex 1085 skippy, err := skipEvents(dAtA[iNdEx:]) 1086 if err != nil { 1087 return err 1088 } 1089 if (skippy < 0) || (iNdEx+skippy) < 0 { 1090 return ErrInvalidLengthEvents 1091 } 1092 if (iNdEx + skippy) > l { 1093 return io.ErrUnexpectedEOF 1094 } 1095 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1096 iNdEx += skippy 1097 } 1098 } 1099 1100 if iNdEx > l { 1101 return io.ErrUnexpectedEOF 1102 } 1103 return nil 1104 } 1105 func (m *Envelope) Unmarshal(dAtA []byte) error { 1106 l := len(dAtA) 1107 iNdEx := 0 1108 for iNdEx < l { 1109 preIndex := iNdEx 1110 var wire uint64 1111 for shift := uint(0); ; shift += 7 { 1112 if shift >= 64 { 1113 return ErrIntOverflowEvents 1114 } 1115 if iNdEx >= l { 1116 return io.ErrUnexpectedEOF 1117 } 1118 b := dAtA[iNdEx] 1119 iNdEx++ 1120 wire |= uint64(b&0x7F) << shift 1121 if b < 0x80 { 1122 break 1123 } 1124 } 1125 fieldNum := int32(wire >> 3) 1126 wireType := int(wire & 0x7) 1127 if wireType == 4 { 1128 return fmt.Errorf("proto: Envelope: wiretype end group for non-group") 1129 } 1130 if fieldNum <= 0 { 1131 return fmt.Errorf("proto: Envelope: illegal tag %d (wire type %d)", fieldNum, wire) 1132 } 1133 switch fieldNum { 1134 case 1: 1135 if wireType != 2 { 1136 return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) 1137 } 1138 var msglen int 1139 for shift := uint(0); ; shift += 7 { 1140 if shift >= 64 { 1141 return ErrIntOverflowEvents 1142 } 1143 if iNdEx >= l { 1144 return io.ErrUnexpectedEOF 1145 } 1146 b := dAtA[iNdEx] 1147 iNdEx++ 1148 msglen |= int(b&0x7F) << shift 1149 if b < 0x80 { 1150 break 1151 } 1152 } 1153 if msglen < 0 { 1154 return ErrInvalidLengthEvents 1155 } 1156 postIndex := iNdEx + msglen 1157 if postIndex < 0 { 1158 return ErrInvalidLengthEvents 1159 } 1160 if postIndex > l { 1161 return io.ErrUnexpectedEOF 1162 } 1163 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { 1164 return err 1165 } 1166 iNdEx = postIndex 1167 case 2: 1168 if wireType != 2 { 1169 return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) 1170 } 1171 var stringLen uint64 1172 for shift := uint(0); ; shift += 7 { 1173 if shift >= 64 { 1174 return ErrIntOverflowEvents 1175 } 1176 if iNdEx >= l { 1177 return io.ErrUnexpectedEOF 1178 } 1179 b := dAtA[iNdEx] 1180 iNdEx++ 1181 stringLen |= uint64(b&0x7F) << shift 1182 if b < 0x80 { 1183 break 1184 } 1185 } 1186 intStringLen := int(stringLen) 1187 if intStringLen < 0 { 1188 return ErrInvalidLengthEvents 1189 } 1190 postIndex := iNdEx + intStringLen 1191 if postIndex < 0 { 1192 return ErrInvalidLengthEvents 1193 } 1194 if postIndex > l { 1195 return io.ErrUnexpectedEOF 1196 } 1197 m.Namespace = string(dAtA[iNdEx:postIndex]) 1198 iNdEx = postIndex 1199 case 3: 1200 if wireType != 2 { 1201 return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType) 1202 } 1203 var stringLen uint64 1204 for shift := uint(0); ; shift += 7 { 1205 if shift >= 64 { 1206 return ErrIntOverflowEvents 1207 } 1208 if iNdEx >= l { 1209 return io.ErrUnexpectedEOF 1210 } 1211 b := dAtA[iNdEx] 1212 iNdEx++ 1213 stringLen |= uint64(b&0x7F) << shift 1214 if b < 0x80 { 1215 break 1216 } 1217 } 1218 intStringLen := int(stringLen) 1219 if intStringLen < 0 { 1220 return ErrInvalidLengthEvents 1221 } 1222 postIndex := iNdEx + intStringLen 1223 if postIndex < 0 { 1224 return ErrInvalidLengthEvents 1225 } 1226 if postIndex > l { 1227 return io.ErrUnexpectedEOF 1228 } 1229 m.Topic = string(dAtA[iNdEx:postIndex]) 1230 iNdEx = postIndex 1231 case 4: 1232 if wireType != 2 { 1233 return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) 1234 } 1235 var msglen int 1236 for shift := uint(0); ; shift += 7 { 1237 if shift >= 64 { 1238 return ErrIntOverflowEvents 1239 } 1240 if iNdEx >= l { 1241 return io.ErrUnexpectedEOF 1242 } 1243 b := dAtA[iNdEx] 1244 iNdEx++ 1245 msglen |= int(b&0x7F) << shift 1246 if b < 0x80 { 1247 break 1248 } 1249 } 1250 if msglen < 0 { 1251 return ErrInvalidLengthEvents 1252 } 1253 postIndex := iNdEx + msglen 1254 if postIndex < 0 { 1255 return ErrInvalidLengthEvents 1256 } 1257 if postIndex > l { 1258 return io.ErrUnexpectedEOF 1259 } 1260 if m.Event == nil { 1261 m.Event = &types.Any{} 1262 } 1263 if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1264 return err 1265 } 1266 iNdEx = postIndex 1267 default: 1268 iNdEx = preIndex 1269 skippy, err := skipEvents(dAtA[iNdEx:]) 1270 if err != nil { 1271 return err 1272 } 1273 if (skippy < 0) || (iNdEx+skippy) < 0 { 1274 return ErrInvalidLengthEvents 1275 } 1276 if (iNdEx + skippy) > l { 1277 return io.ErrUnexpectedEOF 1278 } 1279 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1280 iNdEx += skippy 1281 } 1282 } 1283 1284 if iNdEx > l { 1285 return io.ErrUnexpectedEOF 1286 } 1287 return nil 1288 } 1289 func skipEvents(dAtA []byte) (n int, err error) { 1290 l := len(dAtA) 1291 iNdEx := 0 1292 depth := 0 1293 for iNdEx < l { 1294 var wire uint64 1295 for shift := uint(0); ; shift += 7 { 1296 if shift >= 64 { 1297 return 0, ErrIntOverflowEvents 1298 } 1299 if iNdEx >= l { 1300 return 0, io.ErrUnexpectedEOF 1301 } 1302 b := dAtA[iNdEx] 1303 iNdEx++ 1304 wire |= (uint64(b) & 0x7F) << shift 1305 if b < 0x80 { 1306 break 1307 } 1308 } 1309 wireType := int(wire & 0x7) 1310 switch wireType { 1311 case 0: 1312 for shift := uint(0); ; shift += 7 { 1313 if shift >= 64 { 1314 return 0, ErrIntOverflowEvents 1315 } 1316 if iNdEx >= l { 1317 return 0, io.ErrUnexpectedEOF 1318 } 1319 iNdEx++ 1320 if dAtA[iNdEx-1] < 0x80 { 1321 break 1322 } 1323 } 1324 case 1: 1325 iNdEx += 8 1326 case 2: 1327 var length int 1328 for shift := uint(0); ; shift += 7 { 1329 if shift >= 64 { 1330 return 0, ErrIntOverflowEvents 1331 } 1332 if iNdEx >= l { 1333 return 0, io.ErrUnexpectedEOF 1334 } 1335 b := dAtA[iNdEx] 1336 iNdEx++ 1337 length |= (int(b) & 0x7F) << shift 1338 if b < 0x80 { 1339 break 1340 } 1341 } 1342 if length < 0 { 1343 return 0, ErrInvalidLengthEvents 1344 } 1345 iNdEx += length 1346 case 3: 1347 depth++ 1348 case 4: 1349 if depth == 0 { 1350 return 0, ErrUnexpectedEndOfGroupEvents 1351 } 1352 depth-- 1353 case 5: 1354 iNdEx += 4 1355 default: 1356 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1357 } 1358 if iNdEx < 0 { 1359 return 0, ErrInvalidLengthEvents 1360 } 1361 if depth == 0 { 1362 return iNdEx, nil 1363 } 1364 } 1365 return 0, io.ErrUnexpectedEOF 1366 } 1367 1368 var ( 1369 ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") 1370 ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") 1371 ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") 1372 )