map.pb.go 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: map.proto
  3. /*
  4. Package mapdefaults is a generated protocol buffer package.
  5. It is generated from these files:
  6. map.proto
  7. It has these top-level messages:
  8. MapTest
  9. */
  10. package mapdefaults
  11. import proto "github.com/gogo/protobuf/proto"
  12. import fmt "fmt"
  13. import math "math"
  14. import io "io"
  15. // Reference imports to suppress errors if they are not otherwise used.
  16. var _ = proto.Marshal
  17. var _ = fmt.Errorf
  18. var _ = math.Inf
  19. // This is a compile-time assertion to ensure that this generated file
  20. // is compatible with the proto package it is being compiled against.
  21. // A compilation error at this line likely means your copy of the
  22. // proto package needs to be updated.
  23. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  24. type MapTest struct {
  25. StrStr map[string]string `protobuf:"bytes,1,rep,name=str_str,json=strStr" json:"str_str,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
  26. }
  27. func (m *MapTest) Reset() { *m = MapTest{} }
  28. func (m *MapTest) String() string { return proto.CompactTextString(m) }
  29. func (*MapTest) ProtoMessage() {}
  30. func (*MapTest) Descriptor() ([]byte, []int) { return fileDescriptorMap, []int{0} }
  31. func (m *MapTest) GetStrStr() map[string]string {
  32. if m != nil {
  33. return m.StrStr
  34. }
  35. return nil
  36. }
  37. func init() {
  38. proto.RegisterType((*MapTest)(nil), "mapdefaults.MapTest")
  39. }
  40. func (m *MapTest) Marshal() (dAtA []byte, err error) {
  41. size := m.Size()
  42. dAtA = make([]byte, size)
  43. n, err := m.MarshalTo(dAtA)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return dAtA[:n], nil
  48. }
  49. func (m *MapTest) MarshalTo(dAtA []byte) (int, error) {
  50. var i int
  51. _ = i
  52. var l int
  53. _ = l
  54. if len(m.StrStr) > 0 {
  55. for k := range m.StrStr {
  56. dAtA[i] = 0xa
  57. i++
  58. v := m.StrStr[k]
  59. mapSize := 1 + len(k) + sovMap(uint64(len(k))) + 1 + len(v) + sovMap(uint64(len(v)))
  60. i = encodeVarintMap(dAtA, i, uint64(mapSize))
  61. dAtA[i] = 0xa
  62. i++
  63. i = encodeVarintMap(dAtA, i, uint64(len(k)))
  64. i += copy(dAtA[i:], k)
  65. dAtA[i] = 0x12
  66. i++
  67. i = encodeVarintMap(dAtA, i, uint64(len(v)))
  68. i += copy(dAtA[i:], v)
  69. }
  70. }
  71. return i, nil
  72. }
  73. func encodeFixed64Map(dAtA []byte, offset int, v uint64) int {
  74. dAtA[offset] = uint8(v)
  75. dAtA[offset+1] = uint8(v >> 8)
  76. dAtA[offset+2] = uint8(v >> 16)
  77. dAtA[offset+3] = uint8(v >> 24)
  78. dAtA[offset+4] = uint8(v >> 32)
  79. dAtA[offset+5] = uint8(v >> 40)
  80. dAtA[offset+6] = uint8(v >> 48)
  81. dAtA[offset+7] = uint8(v >> 56)
  82. return offset + 8
  83. }
  84. func encodeFixed32Map(dAtA []byte, offset int, v uint32) int {
  85. dAtA[offset] = uint8(v)
  86. dAtA[offset+1] = uint8(v >> 8)
  87. dAtA[offset+2] = uint8(v >> 16)
  88. dAtA[offset+3] = uint8(v >> 24)
  89. return offset + 4
  90. }
  91. func encodeVarintMap(dAtA []byte, offset int, v uint64) int {
  92. for v >= 1<<7 {
  93. dAtA[offset] = uint8(v&0x7f | 0x80)
  94. v >>= 7
  95. offset++
  96. }
  97. dAtA[offset] = uint8(v)
  98. return offset + 1
  99. }
  100. func (m *MapTest) Size() (n int) {
  101. var l int
  102. _ = l
  103. if len(m.StrStr) > 0 {
  104. for k, v := range m.StrStr {
  105. _ = k
  106. _ = v
  107. mapEntrySize := 1 + len(k) + sovMap(uint64(len(k))) + 1 + len(v) + sovMap(uint64(len(v)))
  108. n += mapEntrySize + 1 + sovMap(uint64(mapEntrySize))
  109. }
  110. }
  111. return n
  112. }
  113. func sovMap(x uint64) (n int) {
  114. for {
  115. n++
  116. x >>= 7
  117. if x == 0 {
  118. break
  119. }
  120. }
  121. return n
  122. }
  123. func sozMap(x uint64) (n int) {
  124. return sovMap(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  125. }
  126. func (m *MapTest) Unmarshal(dAtA []byte) error {
  127. l := len(dAtA)
  128. iNdEx := 0
  129. for iNdEx < l {
  130. preIndex := iNdEx
  131. var wire uint64
  132. for shift := uint(0); ; shift += 7 {
  133. if shift >= 64 {
  134. return ErrIntOverflowMap
  135. }
  136. if iNdEx >= l {
  137. return io.ErrUnexpectedEOF
  138. }
  139. b := dAtA[iNdEx]
  140. iNdEx++
  141. wire |= (uint64(b) & 0x7F) << shift
  142. if b < 0x80 {
  143. break
  144. }
  145. }
  146. fieldNum := int32(wire >> 3)
  147. wireType := int(wire & 0x7)
  148. if wireType == 4 {
  149. return fmt.Errorf("proto: MapTest: wiretype end group for non-group")
  150. }
  151. if fieldNum <= 0 {
  152. return fmt.Errorf("proto: MapTest: illegal tag %d (wire type %d)", fieldNum, wire)
  153. }
  154. switch fieldNum {
  155. case 1:
  156. if wireType != 2 {
  157. return fmt.Errorf("proto: wrong wireType = %d for field StrStr", wireType)
  158. }
  159. var msglen int
  160. for shift := uint(0); ; shift += 7 {
  161. if shift >= 64 {
  162. return ErrIntOverflowMap
  163. }
  164. if iNdEx >= l {
  165. return io.ErrUnexpectedEOF
  166. }
  167. b := dAtA[iNdEx]
  168. iNdEx++
  169. msglen |= (int(b) & 0x7F) << shift
  170. if b < 0x80 {
  171. break
  172. }
  173. }
  174. if msglen < 0 {
  175. return ErrInvalidLengthMap
  176. }
  177. postIndex := iNdEx + msglen
  178. if postIndex > l {
  179. return io.ErrUnexpectedEOF
  180. }
  181. if m.StrStr == nil {
  182. m.StrStr = make(map[string]string)
  183. }
  184. var mapkey string
  185. var mapvalue string
  186. for iNdEx < postIndex {
  187. var wire uint64
  188. for shift := uint(0); ; shift += 7 {
  189. if shift >= 64 {
  190. return ErrIntOverflowMap
  191. }
  192. if iNdEx >= l {
  193. return io.ErrUnexpectedEOF
  194. }
  195. b := dAtA[iNdEx]
  196. iNdEx++
  197. wire |= (uint64(b) & 0x7F) << shift
  198. if b < 0x80 {
  199. break
  200. }
  201. }
  202. fieldNum := int32(wire >> 3)
  203. if fieldNum == 1 {
  204. var stringLenmapkey uint64
  205. for shift := uint(0); ; shift += 7 {
  206. if shift >= 64 {
  207. return ErrIntOverflowMap
  208. }
  209. if iNdEx >= l {
  210. return io.ErrUnexpectedEOF
  211. }
  212. b := dAtA[iNdEx]
  213. iNdEx++
  214. stringLenmapkey |= (uint64(b) & 0x7F) << shift
  215. if b < 0x80 {
  216. break
  217. }
  218. }
  219. intStringLenmapkey := int(stringLenmapkey)
  220. if intStringLenmapkey < 0 {
  221. return ErrInvalidLengthMap
  222. }
  223. postStringIndexmapkey := iNdEx + intStringLenmapkey
  224. if postStringIndexmapkey > l {
  225. return io.ErrUnexpectedEOF
  226. }
  227. mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  228. iNdEx = postStringIndexmapkey
  229. } else {
  230. var stringLenmapvalue uint64
  231. for shift := uint(0); ; shift += 7 {
  232. if shift >= 64 {
  233. return ErrIntOverflowMap
  234. }
  235. if iNdEx >= l {
  236. return io.ErrUnexpectedEOF
  237. }
  238. b := dAtA[iNdEx]
  239. iNdEx++
  240. stringLenmapvalue |= (uint64(b) & 0x7F) << shift
  241. if b < 0x80 {
  242. break
  243. }
  244. }
  245. intStringLenmapvalue := int(stringLenmapvalue)
  246. if intStringLenmapvalue < 0 {
  247. return ErrInvalidLengthMap
  248. }
  249. postStringIndexmapvalue := iNdEx + intStringLenmapvalue
  250. if postStringIndexmapvalue > l {
  251. return io.ErrUnexpectedEOF
  252. }
  253. mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
  254. iNdEx = postStringIndexmapvalue
  255. }
  256. }
  257. m.StrStr[mapkey] = mapvalue
  258. iNdEx = postIndex
  259. default:
  260. iNdEx = preIndex
  261. skippy, err := skipMap(dAtA[iNdEx:])
  262. if err != nil {
  263. return err
  264. }
  265. if skippy < 0 {
  266. return ErrInvalidLengthMap
  267. }
  268. if (iNdEx + skippy) > l {
  269. return io.ErrUnexpectedEOF
  270. }
  271. iNdEx += skippy
  272. }
  273. }
  274. if iNdEx > l {
  275. return io.ErrUnexpectedEOF
  276. }
  277. return nil
  278. }
  279. func skipMap(dAtA []byte) (n int, err error) {
  280. l := len(dAtA)
  281. iNdEx := 0
  282. for iNdEx < l {
  283. var wire uint64
  284. for shift := uint(0); ; shift += 7 {
  285. if shift >= 64 {
  286. return 0, ErrIntOverflowMap
  287. }
  288. if iNdEx >= l {
  289. return 0, io.ErrUnexpectedEOF
  290. }
  291. b := dAtA[iNdEx]
  292. iNdEx++
  293. wire |= (uint64(b) & 0x7F) << shift
  294. if b < 0x80 {
  295. break
  296. }
  297. }
  298. wireType := int(wire & 0x7)
  299. switch wireType {
  300. case 0:
  301. for shift := uint(0); ; shift += 7 {
  302. if shift >= 64 {
  303. return 0, ErrIntOverflowMap
  304. }
  305. if iNdEx >= l {
  306. return 0, io.ErrUnexpectedEOF
  307. }
  308. iNdEx++
  309. if dAtA[iNdEx-1] < 0x80 {
  310. break
  311. }
  312. }
  313. return iNdEx, nil
  314. case 1:
  315. iNdEx += 8
  316. return iNdEx, nil
  317. case 2:
  318. var length int
  319. for shift := uint(0); ; shift += 7 {
  320. if shift >= 64 {
  321. return 0, ErrIntOverflowMap
  322. }
  323. if iNdEx >= l {
  324. return 0, io.ErrUnexpectedEOF
  325. }
  326. b := dAtA[iNdEx]
  327. iNdEx++
  328. length |= (int(b) & 0x7F) << shift
  329. if b < 0x80 {
  330. break
  331. }
  332. }
  333. iNdEx += length
  334. if length < 0 {
  335. return 0, ErrInvalidLengthMap
  336. }
  337. return iNdEx, nil
  338. case 3:
  339. for {
  340. var innerWire uint64
  341. var start int = iNdEx
  342. for shift := uint(0); ; shift += 7 {
  343. if shift >= 64 {
  344. return 0, ErrIntOverflowMap
  345. }
  346. if iNdEx >= l {
  347. return 0, io.ErrUnexpectedEOF
  348. }
  349. b := dAtA[iNdEx]
  350. iNdEx++
  351. innerWire |= (uint64(b) & 0x7F) << shift
  352. if b < 0x80 {
  353. break
  354. }
  355. }
  356. innerWireType := int(innerWire & 0x7)
  357. if innerWireType == 4 {
  358. break
  359. }
  360. next, err := skipMap(dAtA[start:])
  361. if err != nil {
  362. return 0, err
  363. }
  364. iNdEx = start + next
  365. }
  366. return iNdEx, nil
  367. case 4:
  368. return iNdEx, nil
  369. case 5:
  370. iNdEx += 4
  371. return iNdEx, nil
  372. default:
  373. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  374. }
  375. }
  376. panic("unreachable")
  377. }
  378. var (
  379. ErrInvalidLengthMap = fmt.Errorf("proto: negative length found during unmarshaling")
  380. ErrIntOverflowMap = fmt.Errorf("proto: integer overflow")
  381. )
  382. func init() { proto.RegisterFile("map.proto", fileDescriptorMap) }
  383. var fileDescriptorMap = []byte{
  384. // 161 bytes of a gzipped FileDescriptorProto
  385. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcc, 0x4d, 0x2c, 0xd0,
  386. 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xce, 0x4d, 0x2c, 0x48, 0x49, 0x4d, 0x4b, 0x2c, 0xcd,
  387. 0x29, 0x29, 0x56, 0xaa, 0xe7, 0x62, 0xf7, 0x4d, 0x2c, 0x08, 0x49, 0x2d, 0x2e, 0x11, 0xb2, 0xe4,
  388. 0x62, 0x2f, 0x2e, 0x29, 0x8a, 0x2f, 0x2e, 0x29, 0x92, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x52,
  389. 0xd0, 0x43, 0x52, 0xa9, 0x07, 0x55, 0xa6, 0x17, 0x5c, 0x52, 0x14, 0x5c, 0x52, 0xe4, 0x9a, 0x57,
  390. 0x52, 0x54, 0x19, 0xc4, 0x56, 0x0c, 0xe6, 0x48, 0x59, 0x72, 0x71, 0x23, 0x09, 0x0b, 0x09, 0x70,
  391. 0x31, 0x67, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81, 0x98, 0x42, 0x22, 0x5c,
  392. 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c, 0x60, 0x31, 0x08, 0xc7, 0x8a, 0xc9, 0x82, 0xd1,
  393. 0x89, 0xe7, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x4c, 0x62,
  394. 0x03, 0x3b, 0xd1, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x38, 0xe5, 0x24, 0x74, 0xaf, 0x00, 0x00,
  395. 0x00,
  396. }