github.com/containerd/Containerd@v1.4.13/api/services/ttrpc/events/v1/events.pb.go (about)

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