github.com/containerd/containerd@v22.0.0-20200918172823-438c87b8e050+incompatible/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 {
   920  				return ErrInvalidLengthEvents
   921  			}
   922  			if (iNdEx + skippy) < 0 {
   923  				return ErrInvalidLengthEvents
   924  			}
   925  			if (iNdEx + skippy) > l {
   926  				return io.ErrUnexpectedEOF
   927  			}
   928  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   929  			iNdEx += skippy
   930  		}
   931  	}
   932  
   933  	if iNdEx > l {
   934  		return io.ErrUnexpectedEOF
   935  	}
   936  	return nil
   937  }
   938  func (m *ForwardRequest) Unmarshal(dAtA []byte) error {
   939  	l := len(dAtA)
   940  	iNdEx := 0
   941  	for iNdEx < l {
   942  		preIndex := iNdEx
   943  		var wire uint64
   944  		for shift := uint(0); ; shift += 7 {
   945  			if shift >= 64 {
   946  				return ErrIntOverflowEvents
   947  			}
   948  			if iNdEx >= l {
   949  				return io.ErrUnexpectedEOF
   950  			}
   951  			b := dAtA[iNdEx]
   952  			iNdEx++
   953  			wire |= uint64(b&0x7F) << shift
   954  			if b < 0x80 {
   955  				break
   956  			}
   957  		}
   958  		fieldNum := int32(wire >> 3)
   959  		wireType := int(wire & 0x7)
   960  		if wireType == 4 {
   961  			return fmt.Errorf("proto: ForwardRequest: wiretype end group for non-group")
   962  		}
   963  		if fieldNum <= 0 {
   964  			return fmt.Errorf("proto: ForwardRequest: illegal tag %d (wire type %d)", fieldNum, wire)
   965  		}
   966  		switch fieldNum {
   967  		case 1:
   968  			if wireType != 2 {
   969  				return fmt.Errorf("proto: wrong wireType = %d for field Envelope", wireType)
   970  			}
   971  			var msglen int
   972  			for shift := uint(0); ; shift += 7 {
   973  				if shift >= 64 {
   974  					return ErrIntOverflowEvents
   975  				}
   976  				if iNdEx >= l {
   977  					return io.ErrUnexpectedEOF
   978  				}
   979  				b := dAtA[iNdEx]
   980  				iNdEx++
   981  				msglen |= int(b&0x7F) << shift
   982  				if b < 0x80 {
   983  					break
   984  				}
   985  			}
   986  			if msglen < 0 {
   987  				return ErrInvalidLengthEvents
   988  			}
   989  			postIndex := iNdEx + msglen
   990  			if postIndex < 0 {
   991  				return ErrInvalidLengthEvents
   992  			}
   993  			if postIndex > l {
   994  				return io.ErrUnexpectedEOF
   995  			}
   996  			if m.Envelope == nil {
   997  				m.Envelope = &Envelope{}
   998  			}
   999  			if err := m.Envelope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1000  				return err
  1001  			}
  1002  			iNdEx = postIndex
  1003  		default:
  1004  			iNdEx = preIndex
  1005  			skippy, err := skipEvents(dAtA[iNdEx:])
  1006  			if err != nil {
  1007  				return err
  1008  			}
  1009  			if skippy < 0 {
  1010  				return ErrInvalidLengthEvents
  1011  			}
  1012  			if (iNdEx + skippy) < 0 {
  1013  				return ErrInvalidLengthEvents
  1014  			}
  1015  			if (iNdEx + skippy) > l {
  1016  				return io.ErrUnexpectedEOF
  1017  			}
  1018  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1019  			iNdEx += skippy
  1020  		}
  1021  	}
  1022  
  1023  	if iNdEx > l {
  1024  		return io.ErrUnexpectedEOF
  1025  	}
  1026  	return nil
  1027  }
  1028  func (m *SubscribeRequest) Unmarshal(dAtA []byte) error {
  1029  	l := len(dAtA)
  1030  	iNdEx := 0
  1031  	for iNdEx < l {
  1032  		preIndex := iNdEx
  1033  		var wire uint64
  1034  		for shift := uint(0); ; shift += 7 {
  1035  			if shift >= 64 {
  1036  				return ErrIntOverflowEvents
  1037  			}
  1038  			if iNdEx >= l {
  1039  				return io.ErrUnexpectedEOF
  1040  			}
  1041  			b := dAtA[iNdEx]
  1042  			iNdEx++
  1043  			wire |= uint64(b&0x7F) << shift
  1044  			if b < 0x80 {
  1045  				break
  1046  			}
  1047  		}
  1048  		fieldNum := int32(wire >> 3)
  1049  		wireType := int(wire & 0x7)
  1050  		if wireType == 4 {
  1051  			return fmt.Errorf("proto: SubscribeRequest: wiretype end group for non-group")
  1052  		}
  1053  		if fieldNum <= 0 {
  1054  			return fmt.Errorf("proto: SubscribeRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1055  		}
  1056  		switch fieldNum {
  1057  		case 1:
  1058  			if wireType != 2 {
  1059  				return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
  1060  			}
  1061  			var stringLen uint64
  1062  			for shift := uint(0); ; shift += 7 {
  1063  				if shift >= 64 {
  1064  					return ErrIntOverflowEvents
  1065  				}
  1066  				if iNdEx >= l {
  1067  					return io.ErrUnexpectedEOF
  1068  				}
  1069  				b := dAtA[iNdEx]
  1070  				iNdEx++
  1071  				stringLen |= uint64(b&0x7F) << shift
  1072  				if b < 0x80 {
  1073  					break
  1074  				}
  1075  			}
  1076  			intStringLen := int(stringLen)
  1077  			if intStringLen < 0 {
  1078  				return ErrInvalidLengthEvents
  1079  			}
  1080  			postIndex := iNdEx + intStringLen
  1081  			if postIndex < 0 {
  1082  				return ErrInvalidLengthEvents
  1083  			}
  1084  			if postIndex > l {
  1085  				return io.ErrUnexpectedEOF
  1086  			}
  1087  			m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
  1088  			iNdEx = postIndex
  1089  		default:
  1090  			iNdEx = preIndex
  1091  			skippy, err := skipEvents(dAtA[iNdEx:])
  1092  			if err != nil {
  1093  				return err
  1094  			}
  1095  			if skippy < 0 {
  1096  				return ErrInvalidLengthEvents
  1097  			}
  1098  			if (iNdEx + skippy) < 0 {
  1099  				return ErrInvalidLengthEvents
  1100  			}
  1101  			if (iNdEx + skippy) > l {
  1102  				return io.ErrUnexpectedEOF
  1103  			}
  1104  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1105  			iNdEx += skippy
  1106  		}
  1107  	}
  1108  
  1109  	if iNdEx > l {
  1110  		return io.ErrUnexpectedEOF
  1111  	}
  1112  	return nil
  1113  }
  1114  func (m *Envelope) Unmarshal(dAtA []byte) error {
  1115  	l := len(dAtA)
  1116  	iNdEx := 0
  1117  	for iNdEx < l {
  1118  		preIndex := iNdEx
  1119  		var wire uint64
  1120  		for shift := uint(0); ; shift += 7 {
  1121  			if shift >= 64 {
  1122  				return ErrIntOverflowEvents
  1123  			}
  1124  			if iNdEx >= l {
  1125  				return io.ErrUnexpectedEOF
  1126  			}
  1127  			b := dAtA[iNdEx]
  1128  			iNdEx++
  1129  			wire |= uint64(b&0x7F) << shift
  1130  			if b < 0x80 {
  1131  				break
  1132  			}
  1133  		}
  1134  		fieldNum := int32(wire >> 3)
  1135  		wireType := int(wire & 0x7)
  1136  		if wireType == 4 {
  1137  			return fmt.Errorf("proto: Envelope: wiretype end group for non-group")
  1138  		}
  1139  		if fieldNum <= 0 {
  1140  			return fmt.Errorf("proto: Envelope: illegal tag %d (wire type %d)", fieldNum, wire)
  1141  		}
  1142  		switch fieldNum {
  1143  		case 1:
  1144  			if wireType != 2 {
  1145  				return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
  1146  			}
  1147  			var msglen int
  1148  			for shift := uint(0); ; shift += 7 {
  1149  				if shift >= 64 {
  1150  					return ErrIntOverflowEvents
  1151  				}
  1152  				if iNdEx >= l {
  1153  					return io.ErrUnexpectedEOF
  1154  				}
  1155  				b := dAtA[iNdEx]
  1156  				iNdEx++
  1157  				msglen |= int(b&0x7F) << shift
  1158  				if b < 0x80 {
  1159  					break
  1160  				}
  1161  			}
  1162  			if msglen < 0 {
  1163  				return ErrInvalidLengthEvents
  1164  			}
  1165  			postIndex := iNdEx + msglen
  1166  			if postIndex < 0 {
  1167  				return ErrInvalidLengthEvents
  1168  			}
  1169  			if postIndex > l {
  1170  				return io.ErrUnexpectedEOF
  1171  			}
  1172  			if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
  1173  				return err
  1174  			}
  1175  			iNdEx = postIndex
  1176  		case 2:
  1177  			if wireType != 2 {
  1178  				return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
  1179  			}
  1180  			var stringLen uint64
  1181  			for shift := uint(0); ; shift += 7 {
  1182  				if shift >= 64 {
  1183  					return ErrIntOverflowEvents
  1184  				}
  1185  				if iNdEx >= l {
  1186  					return io.ErrUnexpectedEOF
  1187  				}
  1188  				b := dAtA[iNdEx]
  1189  				iNdEx++
  1190  				stringLen |= uint64(b&0x7F) << shift
  1191  				if b < 0x80 {
  1192  					break
  1193  				}
  1194  			}
  1195  			intStringLen := int(stringLen)
  1196  			if intStringLen < 0 {
  1197  				return ErrInvalidLengthEvents
  1198  			}
  1199  			postIndex := iNdEx + intStringLen
  1200  			if postIndex < 0 {
  1201  				return ErrInvalidLengthEvents
  1202  			}
  1203  			if postIndex > l {
  1204  				return io.ErrUnexpectedEOF
  1205  			}
  1206  			m.Namespace = string(dAtA[iNdEx:postIndex])
  1207  			iNdEx = postIndex
  1208  		case 3:
  1209  			if wireType != 2 {
  1210  				return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType)
  1211  			}
  1212  			var stringLen uint64
  1213  			for shift := uint(0); ; shift += 7 {
  1214  				if shift >= 64 {
  1215  					return ErrIntOverflowEvents
  1216  				}
  1217  				if iNdEx >= l {
  1218  					return io.ErrUnexpectedEOF
  1219  				}
  1220  				b := dAtA[iNdEx]
  1221  				iNdEx++
  1222  				stringLen |= uint64(b&0x7F) << shift
  1223  				if b < 0x80 {
  1224  					break
  1225  				}
  1226  			}
  1227  			intStringLen := int(stringLen)
  1228  			if intStringLen < 0 {
  1229  				return ErrInvalidLengthEvents
  1230  			}
  1231  			postIndex := iNdEx + intStringLen
  1232  			if postIndex < 0 {
  1233  				return ErrInvalidLengthEvents
  1234  			}
  1235  			if postIndex > l {
  1236  				return io.ErrUnexpectedEOF
  1237  			}
  1238  			m.Topic = string(dAtA[iNdEx:postIndex])
  1239  			iNdEx = postIndex
  1240  		case 4:
  1241  			if wireType != 2 {
  1242  				return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType)
  1243  			}
  1244  			var msglen int
  1245  			for shift := uint(0); ; shift += 7 {
  1246  				if shift >= 64 {
  1247  					return ErrIntOverflowEvents
  1248  				}
  1249  				if iNdEx >= l {
  1250  					return io.ErrUnexpectedEOF
  1251  				}
  1252  				b := dAtA[iNdEx]
  1253  				iNdEx++
  1254  				msglen |= int(b&0x7F) << shift
  1255  				if b < 0x80 {
  1256  					break
  1257  				}
  1258  			}
  1259  			if msglen < 0 {
  1260  				return ErrInvalidLengthEvents
  1261  			}
  1262  			postIndex := iNdEx + msglen
  1263  			if postIndex < 0 {
  1264  				return ErrInvalidLengthEvents
  1265  			}
  1266  			if postIndex > l {
  1267  				return io.ErrUnexpectedEOF
  1268  			}
  1269  			if m.Event == nil {
  1270  				m.Event = &types.Any{}
  1271  			}
  1272  			if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1273  				return err
  1274  			}
  1275  			iNdEx = postIndex
  1276  		default:
  1277  			iNdEx = preIndex
  1278  			skippy, err := skipEvents(dAtA[iNdEx:])
  1279  			if err != nil {
  1280  				return err
  1281  			}
  1282  			if skippy < 0 {
  1283  				return ErrInvalidLengthEvents
  1284  			}
  1285  			if (iNdEx + skippy) < 0 {
  1286  				return ErrInvalidLengthEvents
  1287  			}
  1288  			if (iNdEx + skippy) > l {
  1289  				return io.ErrUnexpectedEOF
  1290  			}
  1291  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1292  			iNdEx += skippy
  1293  		}
  1294  	}
  1295  
  1296  	if iNdEx > l {
  1297  		return io.ErrUnexpectedEOF
  1298  	}
  1299  	return nil
  1300  }
  1301  func skipEvents(dAtA []byte) (n int, err error) {
  1302  	l := len(dAtA)
  1303  	iNdEx := 0
  1304  	depth := 0
  1305  	for iNdEx < l {
  1306  		var wire uint64
  1307  		for shift := uint(0); ; shift += 7 {
  1308  			if shift >= 64 {
  1309  				return 0, ErrIntOverflowEvents
  1310  			}
  1311  			if iNdEx >= l {
  1312  				return 0, io.ErrUnexpectedEOF
  1313  			}
  1314  			b := dAtA[iNdEx]
  1315  			iNdEx++
  1316  			wire |= (uint64(b) & 0x7F) << shift
  1317  			if b < 0x80 {
  1318  				break
  1319  			}
  1320  		}
  1321  		wireType := int(wire & 0x7)
  1322  		switch wireType {
  1323  		case 0:
  1324  			for shift := uint(0); ; shift += 7 {
  1325  				if shift >= 64 {
  1326  					return 0, ErrIntOverflowEvents
  1327  				}
  1328  				if iNdEx >= l {
  1329  					return 0, io.ErrUnexpectedEOF
  1330  				}
  1331  				iNdEx++
  1332  				if dAtA[iNdEx-1] < 0x80 {
  1333  					break
  1334  				}
  1335  			}
  1336  		case 1:
  1337  			iNdEx += 8
  1338  		case 2:
  1339  			var length int
  1340  			for shift := uint(0); ; shift += 7 {
  1341  				if shift >= 64 {
  1342  					return 0, ErrIntOverflowEvents
  1343  				}
  1344  				if iNdEx >= l {
  1345  					return 0, io.ErrUnexpectedEOF
  1346  				}
  1347  				b := dAtA[iNdEx]
  1348  				iNdEx++
  1349  				length |= (int(b) & 0x7F) << shift
  1350  				if b < 0x80 {
  1351  					break
  1352  				}
  1353  			}
  1354  			if length < 0 {
  1355  				return 0, ErrInvalidLengthEvents
  1356  			}
  1357  			iNdEx += length
  1358  		case 3:
  1359  			depth++
  1360  		case 4:
  1361  			if depth == 0 {
  1362  				return 0, ErrUnexpectedEndOfGroupEvents
  1363  			}
  1364  			depth--
  1365  		case 5:
  1366  			iNdEx += 4
  1367  		default:
  1368  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1369  		}
  1370  		if iNdEx < 0 {
  1371  			return 0, ErrInvalidLengthEvents
  1372  		}
  1373  		if depth == 0 {
  1374  			return iNdEx, nil
  1375  		}
  1376  	}
  1377  	return 0, io.ErrUnexpectedEOF
  1378  }
  1379  
  1380  var (
  1381  	ErrInvalidLengthEvents        = fmt.Errorf("proto: negative length found during unmarshaling")
  1382  	ErrIntOverflowEvents          = fmt.Errorf("proto: integer overflow")
  1383  	ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group")
  1384  )