github.com/m3db/m3@v1.5.0/src/cluster/generated/proto/testpb/test.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: github.com/m3db/m3/src/cluster/generated/proto/testpb/test.proto
     3  
     4  // Copyright (c) 2019 Uber Technologies, Inc.
     5  //
     6  // Permission is hereby granted, free of charge, to any person obtaining a copy
     7  // of this software and associated documentation files (the "Software"), to deal
     8  // in the Software without restriction, including without limitation the rights
     9  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    10  // copies of the Software, and to permit persons to whom the Software is
    11  // furnished to do so, subject to the following conditions:
    12  //
    13  // The above copyright notice and this permission notice shall be included in
    14  // all copies or substantial portions of the Software.
    15  //
    16  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    17  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    18  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    19  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    20  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    21  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    22  // THE SOFTWARE.
    23  
    24  /*
    25  Package testpb is a generated protocol buffer package.
    26  
    27  It is generated from these files:
    28  	github.com/m3db/m3/src/cluster/generated/proto/testpb/test.proto
    29  
    30  It has these top-level messages:
    31  	MapProto
    32  */
    33  package testpb
    34  
    35  import proto "github.com/gogo/protobuf/proto"
    36  import fmt "fmt"
    37  import math "math"
    38  
    39  import io "io"
    40  
    41  // Reference imports to suppress errors if they are not otherwise used.
    42  var _ = proto.Marshal
    43  var _ = fmt.Errorf
    44  var _ = math.Inf
    45  
    46  // This is a compile-time assertion to ensure that this generated file
    47  // is compatible with the proto package it is being compiled against.
    48  // A compilation error at this line likely means your copy of the
    49  // proto package needs to be updated.
    50  const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
    51  
    52  type MapProto struct {
    53  	Value map[string]int64 `protobuf:"bytes,1,rep,name=value" json:"value,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
    54  }
    55  
    56  func (m *MapProto) Reset()                    { *m = MapProto{} }
    57  func (m *MapProto) String() string            { return proto.CompactTextString(m) }
    58  func (*MapProto) ProtoMessage()               {}
    59  func (*MapProto) Descriptor() ([]byte, []int) { return fileDescriptorTest, []int{0} }
    60  
    61  func (m *MapProto) GetValue() map[string]int64 {
    62  	if m != nil {
    63  		return m.Value
    64  	}
    65  	return nil
    66  }
    67  
    68  func init() {
    69  	proto.RegisterType((*MapProto)(nil), "testpb.MapProto")
    70  }
    71  func (m *MapProto) Marshal() (dAtA []byte, err error) {
    72  	size := m.Size()
    73  	dAtA = make([]byte, size)
    74  	n, err := m.MarshalTo(dAtA)
    75  	if err != nil {
    76  		return nil, err
    77  	}
    78  	return dAtA[:n], nil
    79  }
    80  
    81  func (m *MapProto) MarshalTo(dAtA []byte) (int, error) {
    82  	var i int
    83  	_ = i
    84  	var l int
    85  	_ = l
    86  	if len(m.Value) > 0 {
    87  		for k, _ := range m.Value {
    88  			dAtA[i] = 0xa
    89  			i++
    90  			v := m.Value[k]
    91  			mapSize := 1 + len(k) + sovTest(uint64(len(k))) + 1 + sovTest(uint64(v))
    92  			i = encodeVarintTest(dAtA, i, uint64(mapSize))
    93  			dAtA[i] = 0xa
    94  			i++
    95  			i = encodeVarintTest(dAtA, i, uint64(len(k)))
    96  			i += copy(dAtA[i:], k)
    97  			dAtA[i] = 0x10
    98  			i++
    99  			i = encodeVarintTest(dAtA, i, uint64(v))
   100  		}
   101  	}
   102  	return i, nil
   103  }
   104  
   105  func encodeVarintTest(dAtA []byte, offset int, v uint64) int {
   106  	for v >= 1<<7 {
   107  		dAtA[offset] = uint8(v&0x7f | 0x80)
   108  		v >>= 7
   109  		offset++
   110  	}
   111  	dAtA[offset] = uint8(v)
   112  	return offset + 1
   113  }
   114  func (m *MapProto) Size() (n int) {
   115  	var l int
   116  	_ = l
   117  	if len(m.Value) > 0 {
   118  		for k, v := range m.Value {
   119  			_ = k
   120  			_ = v
   121  			mapEntrySize := 1 + len(k) + sovTest(uint64(len(k))) + 1 + sovTest(uint64(v))
   122  			n += mapEntrySize + 1 + sovTest(uint64(mapEntrySize))
   123  		}
   124  	}
   125  	return n
   126  }
   127  
   128  func sovTest(x uint64) (n int) {
   129  	for {
   130  		n++
   131  		x >>= 7
   132  		if x == 0 {
   133  			break
   134  		}
   135  	}
   136  	return n
   137  }
   138  func sozTest(x uint64) (n int) {
   139  	return sovTest(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   140  }
   141  func (m *MapProto) Unmarshal(dAtA []byte) error {
   142  	l := len(dAtA)
   143  	iNdEx := 0
   144  	for iNdEx < l {
   145  		preIndex := iNdEx
   146  		var wire uint64
   147  		for shift := uint(0); ; shift += 7 {
   148  			if shift >= 64 {
   149  				return ErrIntOverflowTest
   150  			}
   151  			if iNdEx >= l {
   152  				return io.ErrUnexpectedEOF
   153  			}
   154  			b := dAtA[iNdEx]
   155  			iNdEx++
   156  			wire |= (uint64(b) & 0x7F) << shift
   157  			if b < 0x80 {
   158  				break
   159  			}
   160  		}
   161  		fieldNum := int32(wire >> 3)
   162  		wireType := int(wire & 0x7)
   163  		if wireType == 4 {
   164  			return fmt.Errorf("proto: MapProto: wiretype end group for non-group")
   165  		}
   166  		if fieldNum <= 0 {
   167  			return fmt.Errorf("proto: MapProto: illegal tag %d (wire type %d)", fieldNum, wire)
   168  		}
   169  		switch fieldNum {
   170  		case 1:
   171  			if wireType != 2 {
   172  				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
   173  			}
   174  			var msglen int
   175  			for shift := uint(0); ; shift += 7 {
   176  				if shift >= 64 {
   177  					return ErrIntOverflowTest
   178  				}
   179  				if iNdEx >= l {
   180  					return io.ErrUnexpectedEOF
   181  				}
   182  				b := dAtA[iNdEx]
   183  				iNdEx++
   184  				msglen |= (int(b) & 0x7F) << shift
   185  				if b < 0x80 {
   186  					break
   187  				}
   188  			}
   189  			if msglen < 0 {
   190  				return ErrInvalidLengthTest
   191  			}
   192  			postIndex := iNdEx + msglen
   193  			if postIndex > l {
   194  				return io.ErrUnexpectedEOF
   195  			}
   196  			if m.Value == nil {
   197  				m.Value = make(map[string]int64)
   198  			}
   199  			var mapkey string
   200  			var mapvalue int64
   201  			for iNdEx < postIndex {
   202  				entryPreIndex := iNdEx
   203  				var wire uint64
   204  				for shift := uint(0); ; shift += 7 {
   205  					if shift >= 64 {
   206  						return ErrIntOverflowTest
   207  					}
   208  					if iNdEx >= l {
   209  						return io.ErrUnexpectedEOF
   210  					}
   211  					b := dAtA[iNdEx]
   212  					iNdEx++
   213  					wire |= (uint64(b) & 0x7F) << shift
   214  					if b < 0x80 {
   215  						break
   216  					}
   217  				}
   218  				fieldNum := int32(wire >> 3)
   219  				if fieldNum == 1 {
   220  					var stringLenmapkey uint64
   221  					for shift := uint(0); ; shift += 7 {
   222  						if shift >= 64 {
   223  							return ErrIntOverflowTest
   224  						}
   225  						if iNdEx >= l {
   226  							return io.ErrUnexpectedEOF
   227  						}
   228  						b := dAtA[iNdEx]
   229  						iNdEx++
   230  						stringLenmapkey |= (uint64(b) & 0x7F) << shift
   231  						if b < 0x80 {
   232  							break
   233  						}
   234  					}
   235  					intStringLenmapkey := int(stringLenmapkey)
   236  					if intStringLenmapkey < 0 {
   237  						return ErrInvalidLengthTest
   238  					}
   239  					postStringIndexmapkey := iNdEx + intStringLenmapkey
   240  					if postStringIndexmapkey > l {
   241  						return io.ErrUnexpectedEOF
   242  					}
   243  					mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
   244  					iNdEx = postStringIndexmapkey
   245  				} else if fieldNum == 2 {
   246  					for shift := uint(0); ; shift += 7 {
   247  						if shift >= 64 {
   248  							return ErrIntOverflowTest
   249  						}
   250  						if iNdEx >= l {
   251  							return io.ErrUnexpectedEOF
   252  						}
   253  						b := dAtA[iNdEx]
   254  						iNdEx++
   255  						mapvalue |= (int64(b) & 0x7F) << shift
   256  						if b < 0x80 {
   257  							break
   258  						}
   259  					}
   260  				} else {
   261  					iNdEx = entryPreIndex
   262  					skippy, err := skipTest(dAtA[iNdEx:])
   263  					if err != nil {
   264  						return err
   265  					}
   266  					if skippy < 0 {
   267  						return ErrInvalidLengthTest
   268  					}
   269  					if (iNdEx + skippy) > postIndex {
   270  						return io.ErrUnexpectedEOF
   271  					}
   272  					iNdEx += skippy
   273  				}
   274  			}
   275  			m.Value[mapkey] = mapvalue
   276  			iNdEx = postIndex
   277  		default:
   278  			iNdEx = preIndex
   279  			skippy, err := skipTest(dAtA[iNdEx:])
   280  			if err != nil {
   281  				return err
   282  			}
   283  			if skippy < 0 {
   284  				return ErrInvalidLengthTest
   285  			}
   286  			if (iNdEx + skippy) > l {
   287  				return io.ErrUnexpectedEOF
   288  			}
   289  			iNdEx += skippy
   290  		}
   291  	}
   292  
   293  	if iNdEx > l {
   294  		return io.ErrUnexpectedEOF
   295  	}
   296  	return nil
   297  }
   298  func skipTest(dAtA []byte) (n int, err error) {
   299  	l := len(dAtA)
   300  	iNdEx := 0
   301  	for iNdEx < l {
   302  		var wire uint64
   303  		for shift := uint(0); ; shift += 7 {
   304  			if shift >= 64 {
   305  				return 0, ErrIntOverflowTest
   306  			}
   307  			if iNdEx >= l {
   308  				return 0, io.ErrUnexpectedEOF
   309  			}
   310  			b := dAtA[iNdEx]
   311  			iNdEx++
   312  			wire |= (uint64(b) & 0x7F) << shift
   313  			if b < 0x80 {
   314  				break
   315  			}
   316  		}
   317  		wireType := int(wire & 0x7)
   318  		switch wireType {
   319  		case 0:
   320  			for shift := uint(0); ; shift += 7 {
   321  				if shift >= 64 {
   322  					return 0, ErrIntOverflowTest
   323  				}
   324  				if iNdEx >= l {
   325  					return 0, io.ErrUnexpectedEOF
   326  				}
   327  				iNdEx++
   328  				if dAtA[iNdEx-1] < 0x80 {
   329  					break
   330  				}
   331  			}
   332  			return iNdEx, nil
   333  		case 1:
   334  			iNdEx += 8
   335  			return iNdEx, nil
   336  		case 2:
   337  			var length int
   338  			for shift := uint(0); ; shift += 7 {
   339  				if shift >= 64 {
   340  					return 0, ErrIntOverflowTest
   341  				}
   342  				if iNdEx >= l {
   343  					return 0, io.ErrUnexpectedEOF
   344  				}
   345  				b := dAtA[iNdEx]
   346  				iNdEx++
   347  				length |= (int(b) & 0x7F) << shift
   348  				if b < 0x80 {
   349  					break
   350  				}
   351  			}
   352  			iNdEx += length
   353  			if length < 0 {
   354  				return 0, ErrInvalidLengthTest
   355  			}
   356  			return iNdEx, nil
   357  		case 3:
   358  			for {
   359  				var innerWire uint64
   360  				var start int = iNdEx
   361  				for shift := uint(0); ; shift += 7 {
   362  					if shift >= 64 {
   363  						return 0, ErrIntOverflowTest
   364  					}
   365  					if iNdEx >= l {
   366  						return 0, io.ErrUnexpectedEOF
   367  					}
   368  					b := dAtA[iNdEx]
   369  					iNdEx++
   370  					innerWire |= (uint64(b) & 0x7F) << shift
   371  					if b < 0x80 {
   372  						break
   373  					}
   374  				}
   375  				innerWireType := int(innerWire & 0x7)
   376  				if innerWireType == 4 {
   377  					break
   378  				}
   379  				next, err := skipTest(dAtA[start:])
   380  				if err != nil {
   381  					return 0, err
   382  				}
   383  				iNdEx = start + next
   384  			}
   385  			return iNdEx, nil
   386  		case 4:
   387  			return iNdEx, nil
   388  		case 5:
   389  			iNdEx += 4
   390  			return iNdEx, nil
   391  		default:
   392  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   393  		}
   394  	}
   395  	panic("unreachable")
   396  }
   397  
   398  var (
   399  	ErrInvalidLengthTest = fmt.Errorf("proto: negative length found during unmarshaling")
   400  	ErrIntOverflowTest   = fmt.Errorf("proto: integer overflow")
   401  )
   402  
   403  func init() {
   404  	proto.RegisterFile("github.com/m3db/m3/src/cluster/generated/proto/testpb/test.proto", fileDescriptorTest)
   405  }
   406  
   407  var fileDescriptorTest = []byte{
   408  	// 192 bytes of a gzipped FileDescriptorProto
   409  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x48, 0xcf, 0x2c, 0xc9,
   410  	0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0x35, 0x4e, 0x49, 0xd2, 0xcf, 0x35, 0xd6, 0x2f,
   411  	0x2e, 0x4a, 0xd6, 0x4f, 0xce, 0x29, 0x2d, 0x2e, 0x49, 0x2d, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d,
   412  	0x4a, 0x2c, 0x49, 0x4d, 0xd1, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x2f, 0x49, 0x2d, 0x2e, 0x29,
   413  	0x48, 0x02, 0x53, 0x7a, 0x60, 0x11, 0x21, 0x36, 0x88, 0x90, 0x52, 0x39, 0x17, 0x87, 0x6f, 0x62,
   414  	0x41, 0x00, 0x58, 0xcc, 0x90, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x51, 0x81, 0x59,
   415  	0x83, 0xdb, 0x48, 0x5a, 0x0f, 0xa2, 0x46, 0x0f, 0xa6, 0x40, 0x2f, 0x0c, 0x24, 0xeb, 0x9a, 0x57,
   416  	0x52, 0x54, 0x19, 0x04, 0x51, 0x29, 0x65, 0xc1, 0xc5, 0x85, 0x10, 0x14, 0x12, 0xe0, 0x62, 0xce,
   417  	0x4e, 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x85, 0x44, 0x60, 0x46, 0x32,
   418  	0x29, 0x30, 0x6a, 0x30, 0x43, 0x75, 0x59, 0x31, 0x59, 0x30, 0x3a, 0x09, 0x9c, 0x78, 0x24, 0xc7,
   419  	0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81,
   420  	0x5d, 0x66, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x47, 0x71, 0x0b, 0xdd, 0x00, 0x00, 0x00,
   421  }