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