deviceid_test.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. // Code generated by protoc-gen-gogo.
  2. // source: deviceid_test.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package protocol is a generated protocol buffer package.
  6. It is generated from these files:
  7. deviceid_test.proto
  8. It has these top-level messages:
  9. TestOldDeviceID
  10. TestNewDeviceID
  11. */
  12. package protocol
  13. import proto "github.com/gogo/protobuf/proto"
  14. import fmt "fmt"
  15. import math "math"
  16. import _ "github.com/gogo/protobuf/gogoproto"
  17. import io "io"
  18. // Reference imports to suppress errors if they are not otherwise used.
  19. var _ = proto.Marshal
  20. var _ = fmt.Errorf
  21. var _ = math.Inf
  22. // This is a compile-time assertion to ensure that this generated file
  23. // is compatible with the proto package it is being compiled against.
  24. const _ = proto.GoGoProtoPackageIsVersion1
  25. type TestOldDeviceID struct {
  26. Test []byte `protobuf:"bytes,1,opt,name=test,proto3" json:"test,omitempty"`
  27. }
  28. func (m *TestOldDeviceID) Reset() { *m = TestOldDeviceID{} }
  29. func (m *TestOldDeviceID) String() string { return proto.CompactTextString(m) }
  30. func (*TestOldDeviceID) ProtoMessage() {}
  31. func (*TestOldDeviceID) Descriptor() ([]byte, []int) { return fileDescriptorDeviceidTest, []int{0} }
  32. type TestNewDeviceID struct {
  33. Test DeviceID `protobuf:"bytes,1,opt,name=test,proto3,customtype=DeviceID" json:"test"`
  34. }
  35. func (m *TestNewDeviceID) Reset() { *m = TestNewDeviceID{} }
  36. func (m *TestNewDeviceID) String() string { return proto.CompactTextString(m) }
  37. func (*TestNewDeviceID) ProtoMessage() {}
  38. func (*TestNewDeviceID) Descriptor() ([]byte, []int) { return fileDescriptorDeviceidTest, []int{1} }
  39. func init() {
  40. proto.RegisterType((*TestOldDeviceID)(nil), "protocol.TestOldDeviceID")
  41. proto.RegisterType((*TestNewDeviceID)(nil), "protocol.TestNewDeviceID")
  42. }
  43. func (m *TestOldDeviceID) Marshal() (data []byte, err error) {
  44. size := m.ProtoSize()
  45. data = make([]byte, size)
  46. n, err := m.MarshalTo(data)
  47. if err != nil {
  48. return nil, err
  49. }
  50. return data[:n], nil
  51. }
  52. func (m *TestOldDeviceID) MarshalTo(data []byte) (int, error) {
  53. var i int
  54. _ = i
  55. var l int
  56. _ = l
  57. if len(m.Test) > 0 {
  58. data[i] = 0xa
  59. i++
  60. i = encodeVarintDeviceidTest(data, i, uint64(len(m.Test)))
  61. i += copy(data[i:], m.Test)
  62. }
  63. return i, nil
  64. }
  65. func (m *TestNewDeviceID) Marshal() (data []byte, err error) {
  66. size := m.ProtoSize()
  67. data = make([]byte, size)
  68. n, err := m.MarshalTo(data)
  69. if err != nil {
  70. return nil, err
  71. }
  72. return data[:n], nil
  73. }
  74. func (m *TestNewDeviceID) MarshalTo(data []byte) (int, error) {
  75. var i int
  76. _ = i
  77. var l int
  78. _ = l
  79. data[i] = 0xa
  80. i++
  81. i = encodeVarintDeviceidTest(data, i, uint64(m.Test.ProtoSize()))
  82. n1, err := m.Test.MarshalTo(data[i:])
  83. if err != nil {
  84. return 0, err
  85. }
  86. i += n1
  87. return i, nil
  88. }
  89. func encodeFixed64DeviceidTest(data []byte, offset int, v uint64) int {
  90. data[offset] = uint8(v)
  91. data[offset+1] = uint8(v >> 8)
  92. data[offset+2] = uint8(v >> 16)
  93. data[offset+3] = uint8(v >> 24)
  94. data[offset+4] = uint8(v >> 32)
  95. data[offset+5] = uint8(v >> 40)
  96. data[offset+6] = uint8(v >> 48)
  97. data[offset+7] = uint8(v >> 56)
  98. return offset + 8
  99. }
  100. func encodeFixed32DeviceidTest(data []byte, offset int, v uint32) int {
  101. data[offset] = uint8(v)
  102. data[offset+1] = uint8(v >> 8)
  103. data[offset+2] = uint8(v >> 16)
  104. data[offset+3] = uint8(v >> 24)
  105. return offset + 4
  106. }
  107. func encodeVarintDeviceidTest(data []byte, offset int, v uint64) int {
  108. for v >= 1<<7 {
  109. data[offset] = uint8(v&0x7f | 0x80)
  110. v >>= 7
  111. offset++
  112. }
  113. data[offset] = uint8(v)
  114. return offset + 1
  115. }
  116. func (m *TestOldDeviceID) ProtoSize() (n int) {
  117. var l int
  118. _ = l
  119. l = len(m.Test)
  120. if l > 0 {
  121. n += 1 + l + sovDeviceidTest(uint64(l))
  122. }
  123. return n
  124. }
  125. func (m *TestNewDeviceID) ProtoSize() (n int) {
  126. var l int
  127. _ = l
  128. l = m.Test.ProtoSize()
  129. n += 1 + l + sovDeviceidTest(uint64(l))
  130. return n
  131. }
  132. func sovDeviceidTest(x uint64) (n int) {
  133. for {
  134. n++
  135. x >>= 7
  136. if x == 0 {
  137. break
  138. }
  139. }
  140. return n
  141. }
  142. func sozDeviceidTest(x uint64) (n int) {
  143. return sovDeviceidTest(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  144. }
  145. func (m *TestOldDeviceID) Unmarshal(data []byte) error {
  146. l := len(data)
  147. iNdEx := 0
  148. for iNdEx < l {
  149. preIndex := iNdEx
  150. var wire uint64
  151. for shift := uint(0); ; shift += 7 {
  152. if shift >= 64 {
  153. return ErrIntOverflowDeviceidTest
  154. }
  155. if iNdEx >= l {
  156. return io.ErrUnexpectedEOF
  157. }
  158. b := data[iNdEx]
  159. iNdEx++
  160. wire |= (uint64(b) & 0x7F) << shift
  161. if b < 0x80 {
  162. break
  163. }
  164. }
  165. fieldNum := int32(wire >> 3)
  166. wireType := int(wire & 0x7)
  167. if wireType == 4 {
  168. return fmt.Errorf("proto: TestOldDeviceID: wiretype end group for non-group")
  169. }
  170. if fieldNum <= 0 {
  171. return fmt.Errorf("proto: TestOldDeviceID: illegal tag %d (wire type %d)", fieldNum, wire)
  172. }
  173. switch fieldNum {
  174. case 1:
  175. if wireType != 2 {
  176. return fmt.Errorf("proto: wrong wireType = %d for field Test", wireType)
  177. }
  178. var byteLen int
  179. for shift := uint(0); ; shift += 7 {
  180. if shift >= 64 {
  181. return ErrIntOverflowDeviceidTest
  182. }
  183. if iNdEx >= l {
  184. return io.ErrUnexpectedEOF
  185. }
  186. b := data[iNdEx]
  187. iNdEx++
  188. byteLen |= (int(b) & 0x7F) << shift
  189. if b < 0x80 {
  190. break
  191. }
  192. }
  193. if byteLen < 0 {
  194. return ErrInvalidLengthDeviceidTest
  195. }
  196. postIndex := iNdEx + byteLen
  197. if postIndex > l {
  198. return io.ErrUnexpectedEOF
  199. }
  200. m.Test = append(m.Test[:0], data[iNdEx:postIndex]...)
  201. if m.Test == nil {
  202. m.Test = []byte{}
  203. }
  204. iNdEx = postIndex
  205. default:
  206. iNdEx = preIndex
  207. skippy, err := skipDeviceidTest(data[iNdEx:])
  208. if err != nil {
  209. return err
  210. }
  211. if skippy < 0 {
  212. return ErrInvalidLengthDeviceidTest
  213. }
  214. if (iNdEx + skippy) > l {
  215. return io.ErrUnexpectedEOF
  216. }
  217. iNdEx += skippy
  218. }
  219. }
  220. if iNdEx > l {
  221. return io.ErrUnexpectedEOF
  222. }
  223. return nil
  224. }
  225. func (m *TestNewDeviceID) Unmarshal(data []byte) error {
  226. l := len(data)
  227. iNdEx := 0
  228. for iNdEx < l {
  229. preIndex := iNdEx
  230. var wire uint64
  231. for shift := uint(0); ; shift += 7 {
  232. if shift >= 64 {
  233. return ErrIntOverflowDeviceidTest
  234. }
  235. if iNdEx >= l {
  236. return io.ErrUnexpectedEOF
  237. }
  238. b := data[iNdEx]
  239. iNdEx++
  240. wire |= (uint64(b) & 0x7F) << shift
  241. if b < 0x80 {
  242. break
  243. }
  244. }
  245. fieldNum := int32(wire >> 3)
  246. wireType := int(wire & 0x7)
  247. if wireType == 4 {
  248. return fmt.Errorf("proto: TestNewDeviceID: wiretype end group for non-group")
  249. }
  250. if fieldNum <= 0 {
  251. return fmt.Errorf("proto: TestNewDeviceID: illegal tag %d (wire type %d)", fieldNum, wire)
  252. }
  253. switch fieldNum {
  254. case 1:
  255. if wireType != 2 {
  256. return fmt.Errorf("proto: wrong wireType = %d for field Test", wireType)
  257. }
  258. var byteLen int
  259. for shift := uint(0); ; shift += 7 {
  260. if shift >= 64 {
  261. return ErrIntOverflowDeviceidTest
  262. }
  263. if iNdEx >= l {
  264. return io.ErrUnexpectedEOF
  265. }
  266. b := data[iNdEx]
  267. iNdEx++
  268. byteLen |= (int(b) & 0x7F) << shift
  269. if b < 0x80 {
  270. break
  271. }
  272. }
  273. if byteLen < 0 {
  274. return ErrInvalidLengthDeviceidTest
  275. }
  276. postIndex := iNdEx + byteLen
  277. if postIndex > l {
  278. return io.ErrUnexpectedEOF
  279. }
  280. if err := m.Test.Unmarshal(data[iNdEx:postIndex]); err != nil {
  281. return err
  282. }
  283. iNdEx = postIndex
  284. default:
  285. iNdEx = preIndex
  286. skippy, err := skipDeviceidTest(data[iNdEx:])
  287. if err != nil {
  288. return err
  289. }
  290. if skippy < 0 {
  291. return ErrInvalidLengthDeviceidTest
  292. }
  293. if (iNdEx + skippy) > l {
  294. return io.ErrUnexpectedEOF
  295. }
  296. iNdEx += skippy
  297. }
  298. }
  299. if iNdEx > l {
  300. return io.ErrUnexpectedEOF
  301. }
  302. return nil
  303. }
  304. func skipDeviceidTest(data []byte) (n int, err error) {
  305. l := len(data)
  306. iNdEx := 0
  307. for iNdEx < l {
  308. var wire uint64
  309. for shift := uint(0); ; shift += 7 {
  310. if shift >= 64 {
  311. return 0, ErrIntOverflowDeviceidTest
  312. }
  313. if iNdEx >= l {
  314. return 0, io.ErrUnexpectedEOF
  315. }
  316. b := data[iNdEx]
  317. iNdEx++
  318. wire |= (uint64(b) & 0x7F) << shift
  319. if b < 0x80 {
  320. break
  321. }
  322. }
  323. wireType := int(wire & 0x7)
  324. switch wireType {
  325. case 0:
  326. for shift := uint(0); ; shift += 7 {
  327. if shift >= 64 {
  328. return 0, ErrIntOverflowDeviceidTest
  329. }
  330. if iNdEx >= l {
  331. return 0, io.ErrUnexpectedEOF
  332. }
  333. iNdEx++
  334. if data[iNdEx-1] < 0x80 {
  335. break
  336. }
  337. }
  338. return iNdEx, nil
  339. case 1:
  340. iNdEx += 8
  341. return iNdEx, nil
  342. case 2:
  343. var length int
  344. for shift := uint(0); ; shift += 7 {
  345. if shift >= 64 {
  346. return 0, ErrIntOverflowDeviceidTest
  347. }
  348. if iNdEx >= l {
  349. return 0, io.ErrUnexpectedEOF
  350. }
  351. b := data[iNdEx]
  352. iNdEx++
  353. length |= (int(b) & 0x7F) << shift
  354. if b < 0x80 {
  355. break
  356. }
  357. }
  358. iNdEx += length
  359. if length < 0 {
  360. return 0, ErrInvalidLengthDeviceidTest
  361. }
  362. return iNdEx, nil
  363. case 3:
  364. for {
  365. var innerWire uint64
  366. var start int = iNdEx
  367. for shift := uint(0); ; shift += 7 {
  368. if shift >= 64 {
  369. return 0, ErrIntOverflowDeviceidTest
  370. }
  371. if iNdEx >= l {
  372. return 0, io.ErrUnexpectedEOF
  373. }
  374. b := data[iNdEx]
  375. iNdEx++
  376. innerWire |= (uint64(b) & 0x7F) << shift
  377. if b < 0x80 {
  378. break
  379. }
  380. }
  381. innerWireType := int(innerWire & 0x7)
  382. if innerWireType == 4 {
  383. break
  384. }
  385. next, err := skipDeviceidTest(data[start:])
  386. if err != nil {
  387. return 0, err
  388. }
  389. iNdEx = start + next
  390. }
  391. return iNdEx, nil
  392. case 4:
  393. return iNdEx, nil
  394. case 5:
  395. iNdEx += 4
  396. return iNdEx, nil
  397. default:
  398. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  399. }
  400. }
  401. panic("unreachable")
  402. }
  403. var (
  404. ErrInvalidLengthDeviceidTest = fmt.Errorf("proto: negative length found during unmarshaling")
  405. ErrIntOverflowDeviceidTest = fmt.Errorf("proto: integer overflow")
  406. )
  407. var fileDescriptorDeviceidTest = []byte{
  408. // 176 bytes of a gzipped FileDescriptorProto
  409. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x49, 0x2d, 0xcb,
  410. 0x4c, 0x4e, 0xcd, 0x4c, 0x89, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
  411. 0xe2, 0x00, 0x53, 0xc9, 0xf9, 0x39, 0x52, 0xba, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9,
  412. 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0xe9, 0xf9, 0xfa, 0x60, 0x99, 0xa4, 0xd2, 0x34, 0x30, 0x0f, 0xcc,
  413. 0x01, 0xb3, 0x20, 0x1a, 0x95, 0x54, 0xb9, 0xf8, 0x43, 0x52, 0x8b, 0x4b, 0xfc, 0x73, 0x52, 0x5c,
  414. 0xc0, 0xc6, 0x7a, 0xba, 0x08, 0x09, 0x71, 0xb1, 0x80, 0x4c, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0,
  415. 0x09, 0x02, 0xb3, 0x95, 0xcc, 0x21, 0xca, 0xfc, 0x52, 0xcb, 0xe1, 0xca, 0x54, 0x90, 0x95, 0x39,
  416. 0x09, 0x9c, 0xb8, 0x27, 0xcf, 0x70, 0xeb, 0x9e, 0x3c, 0x07, 0x4c, 0x1e, 0xa2, 0xd1, 0x49, 0xe6,
  417. 0xc4, 0x43, 0x39, 0x86, 0x0b, 0x0f, 0xe5, 0x18, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e,
  418. 0xf1, 0xc1, 0x23, 0x39, 0x86, 0x17, 0x8f, 0xe4, 0x18, 0x16, 0x3c, 0x96, 0x63, 0x4c, 0x62, 0x03,
  419. 0x3b, 0xc2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x35, 0x9c, 0x00, 0x78, 0xd4, 0x00, 0x00, 0x00,
  420. }