github.com/astaxie/beego@v1.12.3/logs/alils/log.pb.go (about)

     1  package alils
     2  
     3  import (
     4  	"fmt"
     5  	"io"
     6  	"math"
     7  
     8  	"github.com/gogo/protobuf/proto"
     9  	github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
    10  )
    11  
    12  // Reference imports to suppress errors if they are not otherwise used.
    13  var _ = proto.Marshal
    14  var _ = fmt.Errorf
    15  var _ = math.Inf
    16  
    17  var (
    18  	// ErrInvalidLengthLog invalid proto
    19  	ErrInvalidLengthLog = fmt.Errorf("proto: negative length found during unmarshaling")
    20  	// ErrIntOverflowLog overflow
    21  	ErrIntOverflowLog = fmt.Errorf("proto: integer overflow")
    22  )
    23  
    24  // Log define the proto Log
    25  type Log struct {
    26  	Time            *uint32       `protobuf:"varint,1,req,name=Time" json:"Time,omitempty"`
    27  	Contents        []*LogContent `protobuf:"bytes,2,rep,name=Contents" json:"Contents,omitempty"`
    28  	XXXUnrecognized []byte        `json:"-"`
    29  }
    30  
    31  // Reset the Log
    32  func (m *Log) Reset() { *m = Log{} }
    33  
    34  // String return the Compact Log
    35  func (m *Log) String() string { return proto.CompactTextString(m) }
    36  
    37  // ProtoMessage not implemented
    38  func (*Log) ProtoMessage() {}
    39  
    40  // GetTime return the Log's Time
    41  func (m *Log) GetTime() uint32 {
    42  	if m != nil && m.Time != nil {
    43  		return *m.Time
    44  	}
    45  	return 0
    46  }
    47  
    48  // GetContents return the Log's Contents
    49  func (m *Log) GetContents() []*LogContent {
    50  	if m != nil {
    51  		return m.Contents
    52  	}
    53  	return nil
    54  }
    55  
    56  // LogContent define the Log content struct
    57  type LogContent struct {
    58  	Key             *string `protobuf:"bytes,1,req,name=Key" json:"Key,omitempty"`
    59  	Value           *string `protobuf:"bytes,2,req,name=Value" json:"Value,omitempty"`
    60  	XXXUnrecognized []byte  `json:"-"`
    61  }
    62  
    63  // Reset LogContent
    64  func (m *LogContent) Reset() { *m = LogContent{} }
    65  
    66  // String return the compact text
    67  func (m *LogContent) String() string { return proto.CompactTextString(m) }
    68  
    69  // ProtoMessage not implemented
    70  func (*LogContent) ProtoMessage() {}
    71  
    72  // GetKey return the Key
    73  func (m *LogContent) GetKey() string {
    74  	if m != nil && m.Key != nil {
    75  		return *m.Key
    76  	}
    77  	return ""
    78  }
    79  
    80  // GetValue return the Value
    81  func (m *LogContent) GetValue() string {
    82  	if m != nil && m.Value != nil {
    83  		return *m.Value
    84  	}
    85  	return ""
    86  }
    87  
    88  // LogGroup define the logs struct
    89  type LogGroup struct {
    90  	Logs            []*Log  `protobuf:"bytes,1,rep,name=Logs" json:"Logs,omitempty"`
    91  	Reserved        *string `protobuf:"bytes,2,opt,name=Reserved" json:"Reserved,omitempty"`
    92  	Topic           *string `protobuf:"bytes,3,opt,name=Topic" json:"Topic,omitempty"`
    93  	Source          *string `protobuf:"bytes,4,opt,name=Source" json:"Source,omitempty"`
    94  	XXXUnrecognized []byte  `json:"-"`
    95  }
    96  
    97  // Reset LogGroup
    98  func (m *LogGroup) Reset() { *m = LogGroup{} }
    99  
   100  // String return the compact text
   101  func (m *LogGroup) String() string { return proto.CompactTextString(m) }
   102  
   103  // ProtoMessage not implemented
   104  func (*LogGroup) ProtoMessage() {}
   105  
   106  // GetLogs return the loggroup logs
   107  func (m *LogGroup) GetLogs() []*Log {
   108  	if m != nil {
   109  		return m.Logs
   110  	}
   111  	return nil
   112  }
   113  
   114  // GetReserved return Reserved
   115  func (m *LogGroup) GetReserved() string {
   116  	if m != nil && m.Reserved != nil {
   117  		return *m.Reserved
   118  	}
   119  	return ""
   120  }
   121  
   122  // GetTopic return Topic
   123  func (m *LogGroup) GetTopic() string {
   124  	if m != nil && m.Topic != nil {
   125  		return *m.Topic
   126  	}
   127  	return ""
   128  }
   129  
   130  // GetSource return Source
   131  func (m *LogGroup) GetSource() string {
   132  	if m != nil && m.Source != nil {
   133  		return *m.Source
   134  	}
   135  	return ""
   136  }
   137  
   138  // LogGroupList define the LogGroups
   139  type LogGroupList struct {
   140  	LogGroups       []*LogGroup `protobuf:"bytes,1,rep,name=logGroups" json:"logGroups,omitempty"`
   141  	XXXUnrecognized []byte      `json:"-"`
   142  }
   143  
   144  // Reset LogGroupList
   145  func (m *LogGroupList) Reset() { *m = LogGroupList{} }
   146  
   147  // String return compact text
   148  func (m *LogGroupList) String() string { return proto.CompactTextString(m) }
   149  
   150  // ProtoMessage not implemented
   151  func (*LogGroupList) ProtoMessage() {}
   152  
   153  // GetLogGroups return the LogGroups
   154  func (m *LogGroupList) GetLogGroups() []*LogGroup {
   155  	if m != nil {
   156  		return m.LogGroups
   157  	}
   158  	return nil
   159  }
   160  
   161  // Marshal the logs to byte slice
   162  func (m *Log) Marshal() (data []byte, err error) {
   163  	size := m.Size()
   164  	data = make([]byte, size)
   165  	n, err := m.MarshalTo(data)
   166  	if err != nil {
   167  		return nil, err
   168  	}
   169  	return data[:n], nil
   170  }
   171  
   172  // MarshalTo data
   173  func (m *Log) MarshalTo(data []byte) (int, error) {
   174  	var i int
   175  	_ = i
   176  	var l int
   177  	_ = l
   178  	if m.Time == nil {
   179  		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Time")
   180  	}
   181  	data[i] = 0x8
   182  	i++
   183  	i = encodeVarintLog(data, i, uint64(*m.Time))
   184  	if len(m.Contents) > 0 {
   185  		for _, msg := range m.Contents {
   186  			data[i] = 0x12
   187  			i++
   188  			i = encodeVarintLog(data, i, uint64(msg.Size()))
   189  			n, err := msg.MarshalTo(data[i:])
   190  			if err != nil {
   191  				return 0, err
   192  			}
   193  			i += n
   194  		}
   195  	}
   196  	if m.XXXUnrecognized != nil {
   197  		i += copy(data[i:], m.XXXUnrecognized)
   198  	}
   199  	return i, nil
   200  }
   201  
   202  // Marshal LogContent
   203  func (m *LogContent) Marshal() (data []byte, err error) {
   204  	size := m.Size()
   205  	data = make([]byte, size)
   206  	n, err := m.MarshalTo(data)
   207  	if err != nil {
   208  		return nil, err
   209  	}
   210  	return data[:n], nil
   211  }
   212  
   213  // MarshalTo logcontent to data
   214  func (m *LogContent) MarshalTo(data []byte) (int, error) {
   215  	var i int
   216  	_ = i
   217  	var l int
   218  	_ = l
   219  	if m.Key == nil {
   220  		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Key")
   221  	}
   222  	data[i] = 0xa
   223  	i++
   224  	i = encodeVarintLog(data, i, uint64(len(*m.Key)))
   225  	i += copy(data[i:], *m.Key)
   226  
   227  	if m.Value == nil {
   228  		return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Value")
   229  	}
   230  	data[i] = 0x12
   231  	i++
   232  	i = encodeVarintLog(data, i, uint64(len(*m.Value)))
   233  	i += copy(data[i:], *m.Value)
   234  	if m.XXXUnrecognized != nil {
   235  		i += copy(data[i:], m.XXXUnrecognized)
   236  	}
   237  	return i, nil
   238  }
   239  
   240  // Marshal LogGroup
   241  func (m *LogGroup) Marshal() (data []byte, err error) {
   242  	size := m.Size()
   243  	data = make([]byte, size)
   244  	n, err := m.MarshalTo(data)
   245  	if err != nil {
   246  		return nil, err
   247  	}
   248  	return data[:n], nil
   249  }
   250  
   251  // MarshalTo LogGroup to data
   252  func (m *LogGroup) MarshalTo(data []byte) (int, error) {
   253  	var i int
   254  	_ = i
   255  	var l int
   256  	_ = l
   257  	if len(m.Logs) > 0 {
   258  		for _, msg := range m.Logs {
   259  			data[i] = 0xa
   260  			i++
   261  			i = encodeVarintLog(data, i, uint64(msg.Size()))
   262  			n, err := msg.MarshalTo(data[i:])
   263  			if err != nil {
   264  				return 0, err
   265  			}
   266  			i += n
   267  		}
   268  	}
   269  	if m.Reserved != nil {
   270  		data[i] = 0x12
   271  		i++
   272  		i = encodeVarintLog(data, i, uint64(len(*m.Reserved)))
   273  		i += copy(data[i:], *m.Reserved)
   274  	}
   275  	if m.Topic != nil {
   276  		data[i] = 0x1a
   277  		i++
   278  		i = encodeVarintLog(data, i, uint64(len(*m.Topic)))
   279  		i += copy(data[i:], *m.Topic)
   280  	}
   281  	if m.Source != nil {
   282  		data[i] = 0x22
   283  		i++
   284  		i = encodeVarintLog(data, i, uint64(len(*m.Source)))
   285  		i += copy(data[i:], *m.Source)
   286  	}
   287  	if m.XXXUnrecognized != nil {
   288  		i += copy(data[i:], m.XXXUnrecognized)
   289  	}
   290  	return i, nil
   291  }
   292  
   293  // Marshal LogGroupList
   294  func (m *LogGroupList) Marshal() (data []byte, err error) {
   295  	size := m.Size()
   296  	data = make([]byte, size)
   297  	n, err := m.MarshalTo(data)
   298  	if err != nil {
   299  		return nil, err
   300  	}
   301  	return data[:n], nil
   302  }
   303  
   304  // MarshalTo LogGroupList to data
   305  func (m *LogGroupList) MarshalTo(data []byte) (int, error) {
   306  	var i int
   307  	_ = i
   308  	var l int
   309  	_ = l
   310  	if len(m.LogGroups) > 0 {
   311  		for _, msg := range m.LogGroups {
   312  			data[i] = 0xa
   313  			i++
   314  			i = encodeVarintLog(data, i, uint64(msg.Size()))
   315  			n, err := msg.MarshalTo(data[i:])
   316  			if err != nil {
   317  				return 0, err
   318  			}
   319  			i += n
   320  		}
   321  	}
   322  	if m.XXXUnrecognized != nil {
   323  		i += copy(data[i:], m.XXXUnrecognized)
   324  	}
   325  	return i, nil
   326  }
   327  
   328  func encodeFixed64Log(data []byte, offset int, v uint64) int {
   329  	data[offset] = uint8(v)
   330  	data[offset+1] = uint8(v >> 8)
   331  	data[offset+2] = uint8(v >> 16)
   332  	data[offset+3] = uint8(v >> 24)
   333  	data[offset+4] = uint8(v >> 32)
   334  	data[offset+5] = uint8(v >> 40)
   335  	data[offset+6] = uint8(v >> 48)
   336  	data[offset+7] = uint8(v >> 56)
   337  	return offset + 8
   338  }
   339  func encodeFixed32Log(data []byte, offset int, v uint32) int {
   340  	data[offset] = uint8(v)
   341  	data[offset+1] = uint8(v >> 8)
   342  	data[offset+2] = uint8(v >> 16)
   343  	data[offset+3] = uint8(v >> 24)
   344  	return offset + 4
   345  }
   346  func encodeVarintLog(data []byte, offset int, v uint64) int {
   347  	for v >= 1<<7 {
   348  		data[offset] = uint8(v&0x7f | 0x80)
   349  		v >>= 7
   350  		offset++
   351  	}
   352  	data[offset] = uint8(v)
   353  	return offset + 1
   354  }
   355  
   356  // Size return the log's size
   357  func (m *Log) Size() (n int) {
   358  	var l int
   359  	_ = l
   360  	if m.Time != nil {
   361  		n += 1 + sovLog(uint64(*m.Time))
   362  	}
   363  	if len(m.Contents) > 0 {
   364  		for _, e := range m.Contents {
   365  			l = e.Size()
   366  			n += 1 + l + sovLog(uint64(l))
   367  		}
   368  	}
   369  	if m.XXXUnrecognized != nil {
   370  		n += len(m.XXXUnrecognized)
   371  	}
   372  	return n
   373  }
   374  
   375  // Size return LogContent size based on Key and Value
   376  func (m *LogContent) Size() (n int) {
   377  	var l int
   378  	_ = l
   379  	if m.Key != nil {
   380  		l = len(*m.Key)
   381  		n += 1 + l + sovLog(uint64(l))
   382  	}
   383  	if m.Value != nil {
   384  		l = len(*m.Value)
   385  		n += 1 + l + sovLog(uint64(l))
   386  	}
   387  	if m.XXXUnrecognized != nil {
   388  		n += len(m.XXXUnrecognized)
   389  	}
   390  	return n
   391  }
   392  
   393  // Size return LogGroup size based on Logs
   394  func (m *LogGroup) Size() (n int) {
   395  	var l int
   396  	_ = l
   397  	if len(m.Logs) > 0 {
   398  		for _, e := range m.Logs {
   399  			l = e.Size()
   400  			n += 1 + l + sovLog(uint64(l))
   401  		}
   402  	}
   403  	if m.Reserved != nil {
   404  		l = len(*m.Reserved)
   405  		n += 1 + l + sovLog(uint64(l))
   406  	}
   407  	if m.Topic != nil {
   408  		l = len(*m.Topic)
   409  		n += 1 + l + sovLog(uint64(l))
   410  	}
   411  	if m.Source != nil {
   412  		l = len(*m.Source)
   413  		n += 1 + l + sovLog(uint64(l))
   414  	}
   415  	if m.XXXUnrecognized != nil {
   416  		n += len(m.XXXUnrecognized)
   417  	}
   418  	return n
   419  }
   420  
   421  // Size return LogGroupList size
   422  func (m *LogGroupList) Size() (n int) {
   423  	var l int
   424  	_ = l
   425  	if len(m.LogGroups) > 0 {
   426  		for _, e := range m.LogGroups {
   427  			l = e.Size()
   428  			n += 1 + l + sovLog(uint64(l))
   429  		}
   430  	}
   431  	if m.XXXUnrecognized != nil {
   432  		n += len(m.XXXUnrecognized)
   433  	}
   434  	return n
   435  }
   436  
   437  func sovLog(x uint64) (n int) {
   438  	for {
   439  		n++
   440  		x >>= 7
   441  		if x == 0 {
   442  			break
   443  		}
   444  	}
   445  	return n
   446  }
   447  func sozLog(x uint64) (n int) {
   448  	return sovLog((x << 1) ^ (x >> 63))
   449  }
   450  
   451  // Unmarshal data to log
   452  func (m *Log) Unmarshal(data []byte) error {
   453  	var hasFields [1]uint64
   454  	l := len(data)
   455  	iNdEx := 0
   456  	for iNdEx < l {
   457  		preIndex := iNdEx
   458  		var wire uint64
   459  		for shift := uint(0); ; shift += 7 {
   460  			if shift >= 64 {
   461  				return ErrIntOverflowLog
   462  			}
   463  			if iNdEx >= l {
   464  				return io.ErrUnexpectedEOF
   465  			}
   466  			b := data[iNdEx]
   467  			iNdEx++
   468  			wire |= (uint64(b) & 0x7F) << shift
   469  			if b < 0x80 {
   470  				break
   471  			}
   472  		}
   473  		fieldNum := int32(wire >> 3)
   474  		wireType := int(wire & 0x7)
   475  		if wireType == 4 {
   476  			return fmt.Errorf("proto: Log: wiretype end group for non-group")
   477  		}
   478  		if fieldNum <= 0 {
   479  			return fmt.Errorf("proto: Log: illegal tag %d (wire type %d)", fieldNum, wire)
   480  		}
   481  		switch fieldNum {
   482  		case 1:
   483  			if wireType != 0 {
   484  				return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
   485  			}
   486  			var v uint32
   487  			for shift := uint(0); ; shift += 7 {
   488  				if shift >= 64 {
   489  					return ErrIntOverflowLog
   490  				}
   491  				if iNdEx >= l {
   492  					return io.ErrUnexpectedEOF
   493  				}
   494  				b := data[iNdEx]
   495  				iNdEx++
   496  				v |= (uint32(b) & 0x7F) << shift
   497  				if b < 0x80 {
   498  					break
   499  				}
   500  			}
   501  			m.Time = &v
   502  			hasFields[0] |= uint64(0x00000001)
   503  		case 2:
   504  			if wireType != 2 {
   505  				return fmt.Errorf("proto: wrong wireType = %d for field Contents", wireType)
   506  			}
   507  			var msglen int
   508  			for shift := uint(0); ; shift += 7 {
   509  				if shift >= 64 {
   510  					return ErrIntOverflowLog
   511  				}
   512  				if iNdEx >= l {
   513  					return io.ErrUnexpectedEOF
   514  				}
   515  				b := data[iNdEx]
   516  				iNdEx++
   517  				msglen |= (int(b) & 0x7F) << shift
   518  				if b < 0x80 {
   519  					break
   520  				}
   521  			}
   522  			if msglen < 0 {
   523  				return ErrInvalidLengthLog
   524  			}
   525  			postIndex := iNdEx + msglen
   526  			if postIndex > l {
   527  				return io.ErrUnexpectedEOF
   528  			}
   529  			m.Contents = append(m.Contents, &LogContent{})
   530  			if err := m.Contents[len(m.Contents)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
   531  				return err
   532  			}
   533  			iNdEx = postIndex
   534  		default:
   535  			iNdEx = preIndex
   536  			skippy, err := skipLog(data[iNdEx:])
   537  			if err != nil {
   538  				return err
   539  			}
   540  			if skippy < 0 {
   541  				return ErrInvalidLengthLog
   542  			}
   543  			if (iNdEx + skippy) > l {
   544  				return io.ErrUnexpectedEOF
   545  			}
   546  			m.XXXUnrecognized = append(m.XXXUnrecognized, data[iNdEx:iNdEx+skippy]...)
   547  			iNdEx += skippy
   548  		}
   549  	}
   550  	if hasFields[0]&uint64(0x00000001) == 0 {
   551  		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Time")
   552  	}
   553  
   554  	if iNdEx > l {
   555  		return io.ErrUnexpectedEOF
   556  	}
   557  	return nil
   558  }
   559  
   560  // Unmarshal data to LogContent
   561  func (m *LogContent) Unmarshal(data []byte) error {
   562  	var hasFields [1]uint64
   563  	l := len(data)
   564  	iNdEx := 0
   565  	for iNdEx < l {
   566  		preIndex := iNdEx
   567  		var wire uint64
   568  		for shift := uint(0); ; shift += 7 {
   569  			if shift >= 64 {
   570  				return ErrIntOverflowLog
   571  			}
   572  			if iNdEx >= l {
   573  				return io.ErrUnexpectedEOF
   574  			}
   575  			b := data[iNdEx]
   576  			iNdEx++
   577  			wire |= (uint64(b) & 0x7F) << shift
   578  			if b < 0x80 {
   579  				break
   580  			}
   581  		}
   582  		fieldNum := int32(wire >> 3)
   583  		wireType := int(wire & 0x7)
   584  		if wireType == 4 {
   585  			return fmt.Errorf("proto: Content: wiretype end group for non-group")
   586  		}
   587  		if fieldNum <= 0 {
   588  			return fmt.Errorf("proto: Content: illegal tag %d (wire type %d)", fieldNum, wire)
   589  		}
   590  		switch fieldNum {
   591  		case 1:
   592  			if wireType != 2 {
   593  				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
   594  			}
   595  			var stringLen uint64
   596  			for shift := uint(0); ; shift += 7 {
   597  				if shift >= 64 {
   598  					return ErrIntOverflowLog
   599  				}
   600  				if iNdEx >= l {
   601  					return io.ErrUnexpectedEOF
   602  				}
   603  				b := data[iNdEx]
   604  				iNdEx++
   605  				stringLen |= (uint64(b) & 0x7F) << shift
   606  				if b < 0x80 {
   607  					break
   608  				}
   609  			}
   610  			intStringLen := int(stringLen)
   611  			if intStringLen < 0 {
   612  				return ErrInvalidLengthLog
   613  			}
   614  			postIndex := iNdEx + intStringLen
   615  			if postIndex > l {
   616  				return io.ErrUnexpectedEOF
   617  			}
   618  			s := string(data[iNdEx:postIndex])
   619  			m.Key = &s
   620  			iNdEx = postIndex
   621  			hasFields[0] |= uint64(0x00000001)
   622  		case 2:
   623  			if wireType != 2 {
   624  				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
   625  			}
   626  			var stringLen uint64
   627  			for shift := uint(0); ; shift += 7 {
   628  				if shift >= 64 {
   629  					return ErrIntOverflowLog
   630  				}
   631  				if iNdEx >= l {
   632  					return io.ErrUnexpectedEOF
   633  				}
   634  				b := data[iNdEx]
   635  				iNdEx++
   636  				stringLen |= (uint64(b) & 0x7F) << shift
   637  				if b < 0x80 {
   638  					break
   639  				}
   640  			}
   641  			intStringLen := int(stringLen)
   642  			if intStringLen < 0 {
   643  				return ErrInvalidLengthLog
   644  			}
   645  			postIndex := iNdEx + intStringLen
   646  			if postIndex > l {
   647  				return io.ErrUnexpectedEOF
   648  			}
   649  			s := string(data[iNdEx:postIndex])
   650  			m.Value = &s
   651  			iNdEx = postIndex
   652  			hasFields[0] |= uint64(0x00000002)
   653  		default:
   654  			iNdEx = preIndex
   655  			skippy, err := skipLog(data[iNdEx:])
   656  			if err != nil {
   657  				return err
   658  			}
   659  			if skippy < 0 {
   660  				return ErrInvalidLengthLog
   661  			}
   662  			if (iNdEx + skippy) > l {
   663  				return io.ErrUnexpectedEOF
   664  			}
   665  			m.XXXUnrecognized = append(m.XXXUnrecognized, data[iNdEx:iNdEx+skippy]...)
   666  			iNdEx += skippy
   667  		}
   668  	}
   669  	if hasFields[0]&uint64(0x00000001) == 0 {
   670  		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Key")
   671  	}
   672  	if hasFields[0]&uint64(0x00000002) == 0 {
   673  		return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Value")
   674  	}
   675  
   676  	if iNdEx > l {
   677  		return io.ErrUnexpectedEOF
   678  	}
   679  	return nil
   680  }
   681  
   682  // Unmarshal data to LogGroup
   683  func (m *LogGroup) Unmarshal(data []byte) error {
   684  	l := len(data)
   685  	iNdEx := 0
   686  	for iNdEx < l {
   687  		preIndex := iNdEx
   688  		var wire uint64
   689  		for shift := uint(0); ; shift += 7 {
   690  			if shift >= 64 {
   691  				return ErrIntOverflowLog
   692  			}
   693  			if iNdEx >= l {
   694  				return io.ErrUnexpectedEOF
   695  			}
   696  			b := data[iNdEx]
   697  			iNdEx++
   698  			wire |= (uint64(b) & 0x7F) << shift
   699  			if b < 0x80 {
   700  				break
   701  			}
   702  		}
   703  		fieldNum := int32(wire >> 3)
   704  		wireType := int(wire & 0x7)
   705  		if wireType == 4 {
   706  			return fmt.Errorf("proto: LogGroup: wiretype end group for non-group")
   707  		}
   708  		if fieldNum <= 0 {
   709  			return fmt.Errorf("proto: LogGroup: illegal tag %d (wire type %d)", fieldNum, wire)
   710  		}
   711  		switch fieldNum {
   712  		case 1:
   713  			if wireType != 2 {
   714  				return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType)
   715  			}
   716  			var msglen int
   717  			for shift := uint(0); ; shift += 7 {
   718  				if shift >= 64 {
   719  					return ErrIntOverflowLog
   720  				}
   721  				if iNdEx >= l {
   722  					return io.ErrUnexpectedEOF
   723  				}
   724  				b := data[iNdEx]
   725  				iNdEx++
   726  				msglen |= (int(b) & 0x7F) << shift
   727  				if b < 0x80 {
   728  					break
   729  				}
   730  			}
   731  			if msglen < 0 {
   732  				return ErrInvalidLengthLog
   733  			}
   734  			postIndex := iNdEx + msglen
   735  			if postIndex > l {
   736  				return io.ErrUnexpectedEOF
   737  			}
   738  			m.Logs = append(m.Logs, &Log{})
   739  			if err := m.Logs[len(m.Logs)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
   740  				return err
   741  			}
   742  			iNdEx = postIndex
   743  		case 2:
   744  			if wireType != 2 {
   745  				return fmt.Errorf("proto: wrong wireType = %d for field Reserved", wireType)
   746  			}
   747  			var stringLen uint64
   748  			for shift := uint(0); ; shift += 7 {
   749  				if shift >= 64 {
   750  					return ErrIntOverflowLog
   751  				}
   752  				if iNdEx >= l {
   753  					return io.ErrUnexpectedEOF
   754  				}
   755  				b := data[iNdEx]
   756  				iNdEx++
   757  				stringLen |= (uint64(b) & 0x7F) << shift
   758  				if b < 0x80 {
   759  					break
   760  				}
   761  			}
   762  			intStringLen := int(stringLen)
   763  			if intStringLen < 0 {
   764  				return ErrInvalidLengthLog
   765  			}
   766  			postIndex := iNdEx + intStringLen
   767  			if postIndex > l {
   768  				return io.ErrUnexpectedEOF
   769  			}
   770  			s := string(data[iNdEx:postIndex])
   771  			m.Reserved = &s
   772  			iNdEx = postIndex
   773  		case 3:
   774  			if wireType != 2 {
   775  				return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType)
   776  			}
   777  			var stringLen uint64
   778  			for shift := uint(0); ; shift += 7 {
   779  				if shift >= 64 {
   780  					return ErrIntOverflowLog
   781  				}
   782  				if iNdEx >= l {
   783  					return io.ErrUnexpectedEOF
   784  				}
   785  				b := data[iNdEx]
   786  				iNdEx++
   787  				stringLen |= (uint64(b) & 0x7F) << shift
   788  				if b < 0x80 {
   789  					break
   790  				}
   791  			}
   792  			intStringLen := int(stringLen)
   793  			if intStringLen < 0 {
   794  				return ErrInvalidLengthLog
   795  			}
   796  			postIndex := iNdEx + intStringLen
   797  			if postIndex > l {
   798  				return io.ErrUnexpectedEOF
   799  			}
   800  			s := string(data[iNdEx:postIndex])
   801  			m.Topic = &s
   802  			iNdEx = postIndex
   803  		case 4:
   804  			if wireType != 2 {
   805  				return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType)
   806  			}
   807  			var stringLen uint64
   808  			for shift := uint(0); ; shift += 7 {
   809  				if shift >= 64 {
   810  					return ErrIntOverflowLog
   811  				}
   812  				if iNdEx >= l {
   813  					return io.ErrUnexpectedEOF
   814  				}
   815  				b := data[iNdEx]
   816  				iNdEx++
   817  				stringLen |= (uint64(b) & 0x7F) << shift
   818  				if b < 0x80 {
   819  					break
   820  				}
   821  			}
   822  			intStringLen := int(stringLen)
   823  			if intStringLen < 0 {
   824  				return ErrInvalidLengthLog
   825  			}
   826  			postIndex := iNdEx + intStringLen
   827  			if postIndex > l {
   828  				return io.ErrUnexpectedEOF
   829  			}
   830  			s := string(data[iNdEx:postIndex])
   831  			m.Source = &s
   832  			iNdEx = postIndex
   833  		default:
   834  			iNdEx = preIndex
   835  			skippy, err := skipLog(data[iNdEx:])
   836  			if err != nil {
   837  				return err
   838  			}
   839  			if skippy < 0 {
   840  				return ErrInvalidLengthLog
   841  			}
   842  			if (iNdEx + skippy) > l {
   843  				return io.ErrUnexpectedEOF
   844  			}
   845  			m.XXXUnrecognized = append(m.XXXUnrecognized, data[iNdEx:iNdEx+skippy]...)
   846  			iNdEx += skippy
   847  		}
   848  	}
   849  
   850  	if iNdEx > l {
   851  		return io.ErrUnexpectedEOF
   852  	}
   853  	return nil
   854  }
   855  
   856  // Unmarshal data to LogGroupList
   857  func (m *LogGroupList) Unmarshal(data []byte) error {
   858  	l := len(data)
   859  	iNdEx := 0
   860  	for iNdEx < l {
   861  		preIndex := iNdEx
   862  		var wire uint64
   863  		for shift := uint(0); ; shift += 7 {
   864  			if shift >= 64 {
   865  				return ErrIntOverflowLog
   866  			}
   867  			if iNdEx >= l {
   868  				return io.ErrUnexpectedEOF
   869  			}
   870  			b := data[iNdEx]
   871  			iNdEx++
   872  			wire |= (uint64(b) & 0x7F) << shift
   873  			if b < 0x80 {
   874  				break
   875  			}
   876  		}
   877  		fieldNum := int32(wire >> 3)
   878  		wireType := int(wire & 0x7)
   879  		if wireType == 4 {
   880  			return fmt.Errorf("proto: LogGroupList: wiretype end group for non-group")
   881  		}
   882  		if fieldNum <= 0 {
   883  			return fmt.Errorf("proto: LogGroupList: illegal tag %d (wire type %d)", fieldNum, wire)
   884  		}
   885  		switch fieldNum {
   886  		case 1:
   887  			if wireType != 2 {
   888  				return fmt.Errorf("proto: wrong wireType = %d for field LogGroups", wireType)
   889  			}
   890  			var msglen int
   891  			for shift := uint(0); ; shift += 7 {
   892  				if shift >= 64 {
   893  					return ErrIntOverflowLog
   894  				}
   895  				if iNdEx >= l {
   896  					return io.ErrUnexpectedEOF
   897  				}
   898  				b := data[iNdEx]
   899  				iNdEx++
   900  				msglen |= (int(b) & 0x7F) << shift
   901  				if b < 0x80 {
   902  					break
   903  				}
   904  			}
   905  			if msglen < 0 {
   906  				return ErrInvalidLengthLog
   907  			}
   908  			postIndex := iNdEx + msglen
   909  			if postIndex > l {
   910  				return io.ErrUnexpectedEOF
   911  			}
   912  			m.LogGroups = append(m.LogGroups, &LogGroup{})
   913  			if err := m.LogGroups[len(m.LogGroups)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
   914  				return err
   915  			}
   916  			iNdEx = postIndex
   917  		default:
   918  			iNdEx = preIndex
   919  			skippy, err := skipLog(data[iNdEx:])
   920  			if err != nil {
   921  				return err
   922  			}
   923  			if skippy < 0 {
   924  				return ErrInvalidLengthLog
   925  			}
   926  			if (iNdEx + skippy) > l {
   927  				return io.ErrUnexpectedEOF
   928  			}
   929  			m.XXXUnrecognized = append(m.XXXUnrecognized, data[iNdEx:iNdEx+skippy]...)
   930  			iNdEx += skippy
   931  		}
   932  	}
   933  
   934  	if iNdEx > l {
   935  		return io.ErrUnexpectedEOF
   936  	}
   937  	return nil
   938  }
   939  
   940  func skipLog(data []byte) (n int, err error) {
   941  	l := len(data)
   942  	iNdEx := 0
   943  	for iNdEx < l {
   944  		var wire uint64
   945  		for shift := uint(0); ; shift += 7 {
   946  			if shift >= 64 {
   947  				return 0, ErrIntOverflowLog
   948  			}
   949  			if iNdEx >= l {
   950  				return 0, io.ErrUnexpectedEOF
   951  			}
   952  			b := data[iNdEx]
   953  			iNdEx++
   954  			wire |= (uint64(b) & 0x7F) << shift
   955  			if b < 0x80 {
   956  				break
   957  			}
   958  		}
   959  		wireType := int(wire & 0x7)
   960  		switch wireType {
   961  		case 0:
   962  			for shift := uint(0); ; shift += 7 {
   963  				if shift >= 64 {
   964  					return 0, ErrIntOverflowLog
   965  				}
   966  				if iNdEx >= l {
   967  					return 0, io.ErrUnexpectedEOF
   968  				}
   969  				iNdEx++
   970  				if data[iNdEx-1] < 0x80 {
   971  					break
   972  				}
   973  			}
   974  			return iNdEx, nil
   975  		case 1:
   976  			iNdEx += 8
   977  			return iNdEx, nil
   978  		case 2:
   979  			var length int
   980  			for shift := uint(0); ; shift += 7 {
   981  				if shift >= 64 {
   982  					return 0, ErrIntOverflowLog
   983  				}
   984  				if iNdEx >= l {
   985  					return 0, io.ErrUnexpectedEOF
   986  				}
   987  				b := data[iNdEx]
   988  				iNdEx++
   989  				length |= (int(b) & 0x7F) << shift
   990  				if b < 0x80 {
   991  					break
   992  				}
   993  			}
   994  			iNdEx += length
   995  			if length < 0 {
   996  				return 0, ErrInvalidLengthLog
   997  			}
   998  			return iNdEx, nil
   999  		case 3:
  1000  			for {
  1001  				var innerWire uint64
  1002  				var start = iNdEx
  1003  				for shift := uint(0); ; shift += 7 {
  1004  					if shift >= 64 {
  1005  						return 0, ErrIntOverflowLog
  1006  					}
  1007  					if iNdEx >= l {
  1008  						return 0, io.ErrUnexpectedEOF
  1009  					}
  1010  					b := data[iNdEx]
  1011  					iNdEx++
  1012  					innerWire |= (uint64(b) & 0x7F) << shift
  1013  					if b < 0x80 {
  1014  						break
  1015  					}
  1016  				}
  1017  				innerWireType := int(innerWire & 0x7)
  1018  				if innerWireType == 4 {
  1019  					break
  1020  				}
  1021  				next, err := skipLog(data[start:])
  1022  				if err != nil {
  1023  					return 0, err
  1024  				}
  1025  				iNdEx = start + next
  1026  			}
  1027  			return iNdEx, nil
  1028  		case 4:
  1029  			return iNdEx, nil
  1030  		case 5:
  1031  			iNdEx += 4
  1032  			return iNdEx, nil
  1033  		default:
  1034  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1035  		}
  1036  	}
  1037  	panic("unreachable")
  1038  }