local.pb.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. // Code generated by protoc-gen-gogo.
  2. // source: local.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package discover is a generated protocol buffer package.
  6. It is generated from these files:
  7. local.proto
  8. It has these top-level messages:
  9. Announce
  10. */
  11. package discover
  12. import proto "github.com/gogo/protobuf/proto"
  13. import fmt "fmt"
  14. import math "math"
  15. import _ "github.com/gogo/protobuf/gogoproto"
  16. import github_com_syncthing_syncthing_lib_protocol "github.com/syncthing/syncthing/lib/protocol"
  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. // A compilation error at this line likely means your copy of the
  25. // proto package needs to be updated.
  26. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  27. type Announce struct {
  28. ID github_com_syncthing_syncthing_lib_protocol.DeviceID `protobuf:"bytes,1,opt,name=id,proto3,customtype=github.com/syncthing/syncthing/lib/protocol.DeviceID" json:"id"`
  29. Addresses []string `protobuf:"bytes,2,rep,name=addresses" json:"addresses,omitempty"`
  30. InstanceID int64 `protobuf:"varint,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
  31. }
  32. func (m *Announce) Reset() { *m = Announce{} }
  33. func (m *Announce) String() string { return proto.CompactTextString(m) }
  34. func (*Announce) ProtoMessage() {}
  35. func (*Announce) Descriptor() ([]byte, []int) { return fileDescriptorLocal, []int{0} }
  36. func init() {
  37. proto.RegisterType((*Announce)(nil), "discover.Announce")
  38. }
  39. func (m *Announce) Marshal() (dAtA []byte, err error) {
  40. size := m.ProtoSize()
  41. dAtA = make([]byte, size)
  42. n, err := m.MarshalTo(dAtA)
  43. if err != nil {
  44. return nil, err
  45. }
  46. return dAtA[:n], nil
  47. }
  48. func (m *Announce) MarshalTo(dAtA []byte) (int, error) {
  49. var i int
  50. _ = i
  51. var l int
  52. _ = l
  53. dAtA[i] = 0xa
  54. i++
  55. i = encodeVarintLocal(dAtA, i, uint64(m.ID.ProtoSize()))
  56. n1, err := m.ID.MarshalTo(dAtA[i:])
  57. if err != nil {
  58. return 0, err
  59. }
  60. i += n1
  61. if len(m.Addresses) > 0 {
  62. for _, s := range m.Addresses {
  63. dAtA[i] = 0x12
  64. i++
  65. l = len(s)
  66. for l >= 1<<7 {
  67. dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
  68. l >>= 7
  69. i++
  70. }
  71. dAtA[i] = uint8(l)
  72. i++
  73. i += copy(dAtA[i:], s)
  74. }
  75. }
  76. if m.InstanceID != 0 {
  77. dAtA[i] = 0x18
  78. i++
  79. i = encodeVarintLocal(dAtA, i, uint64(m.InstanceID))
  80. }
  81. return i, nil
  82. }
  83. func encodeFixed64Local(dAtA []byte, offset int, v uint64) int {
  84. dAtA[offset] = uint8(v)
  85. dAtA[offset+1] = uint8(v >> 8)
  86. dAtA[offset+2] = uint8(v >> 16)
  87. dAtA[offset+3] = uint8(v >> 24)
  88. dAtA[offset+4] = uint8(v >> 32)
  89. dAtA[offset+5] = uint8(v >> 40)
  90. dAtA[offset+6] = uint8(v >> 48)
  91. dAtA[offset+7] = uint8(v >> 56)
  92. return offset + 8
  93. }
  94. func encodeFixed32Local(dAtA []byte, offset int, v uint32) int {
  95. dAtA[offset] = uint8(v)
  96. dAtA[offset+1] = uint8(v >> 8)
  97. dAtA[offset+2] = uint8(v >> 16)
  98. dAtA[offset+3] = uint8(v >> 24)
  99. return offset + 4
  100. }
  101. func encodeVarintLocal(dAtA []byte, offset int, v uint64) int {
  102. for v >= 1<<7 {
  103. dAtA[offset] = uint8(v&0x7f | 0x80)
  104. v >>= 7
  105. offset++
  106. }
  107. dAtA[offset] = uint8(v)
  108. return offset + 1
  109. }
  110. func (m *Announce) ProtoSize() (n int) {
  111. var l int
  112. _ = l
  113. l = m.ID.ProtoSize()
  114. n += 1 + l + sovLocal(uint64(l))
  115. if len(m.Addresses) > 0 {
  116. for _, s := range m.Addresses {
  117. l = len(s)
  118. n += 1 + l + sovLocal(uint64(l))
  119. }
  120. }
  121. if m.InstanceID != 0 {
  122. n += 1 + sovLocal(uint64(m.InstanceID))
  123. }
  124. return n
  125. }
  126. func sovLocal(x uint64) (n int) {
  127. for {
  128. n++
  129. x >>= 7
  130. if x == 0 {
  131. break
  132. }
  133. }
  134. return n
  135. }
  136. func sozLocal(x uint64) (n int) {
  137. return sovLocal(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  138. }
  139. func (m *Announce) Unmarshal(dAtA []byte) error {
  140. l := len(dAtA)
  141. iNdEx := 0
  142. for iNdEx < l {
  143. preIndex := iNdEx
  144. var wire uint64
  145. for shift := uint(0); ; shift += 7 {
  146. if shift >= 64 {
  147. return ErrIntOverflowLocal
  148. }
  149. if iNdEx >= l {
  150. return io.ErrUnexpectedEOF
  151. }
  152. b := dAtA[iNdEx]
  153. iNdEx++
  154. wire |= (uint64(b) & 0x7F) << shift
  155. if b < 0x80 {
  156. break
  157. }
  158. }
  159. fieldNum := int32(wire >> 3)
  160. wireType := int(wire & 0x7)
  161. if wireType == 4 {
  162. return fmt.Errorf("proto: Announce: wiretype end group for non-group")
  163. }
  164. if fieldNum <= 0 {
  165. return fmt.Errorf("proto: Announce: illegal tag %d (wire type %d)", fieldNum, wire)
  166. }
  167. switch fieldNum {
  168. case 1:
  169. if wireType != 2 {
  170. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  171. }
  172. var byteLen int
  173. for shift := uint(0); ; shift += 7 {
  174. if shift >= 64 {
  175. return ErrIntOverflowLocal
  176. }
  177. if iNdEx >= l {
  178. return io.ErrUnexpectedEOF
  179. }
  180. b := dAtA[iNdEx]
  181. iNdEx++
  182. byteLen |= (int(b) & 0x7F) << shift
  183. if b < 0x80 {
  184. break
  185. }
  186. }
  187. if byteLen < 0 {
  188. return ErrInvalidLengthLocal
  189. }
  190. postIndex := iNdEx + byteLen
  191. if postIndex > l {
  192. return io.ErrUnexpectedEOF
  193. }
  194. if err := m.ID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  195. return err
  196. }
  197. iNdEx = postIndex
  198. case 2:
  199. if wireType != 2 {
  200. return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
  201. }
  202. var stringLen uint64
  203. for shift := uint(0); ; shift += 7 {
  204. if shift >= 64 {
  205. return ErrIntOverflowLocal
  206. }
  207. if iNdEx >= l {
  208. return io.ErrUnexpectedEOF
  209. }
  210. b := dAtA[iNdEx]
  211. iNdEx++
  212. stringLen |= (uint64(b) & 0x7F) << shift
  213. if b < 0x80 {
  214. break
  215. }
  216. }
  217. intStringLen := int(stringLen)
  218. if intStringLen < 0 {
  219. return ErrInvalidLengthLocal
  220. }
  221. postIndex := iNdEx + intStringLen
  222. if postIndex > l {
  223. return io.ErrUnexpectedEOF
  224. }
  225. m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex]))
  226. iNdEx = postIndex
  227. case 3:
  228. if wireType != 0 {
  229. return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType)
  230. }
  231. m.InstanceID = 0
  232. for shift := uint(0); ; shift += 7 {
  233. if shift >= 64 {
  234. return ErrIntOverflowLocal
  235. }
  236. if iNdEx >= l {
  237. return io.ErrUnexpectedEOF
  238. }
  239. b := dAtA[iNdEx]
  240. iNdEx++
  241. m.InstanceID |= (int64(b) & 0x7F) << shift
  242. if b < 0x80 {
  243. break
  244. }
  245. }
  246. default:
  247. iNdEx = preIndex
  248. skippy, err := skipLocal(dAtA[iNdEx:])
  249. if err != nil {
  250. return err
  251. }
  252. if skippy < 0 {
  253. return ErrInvalidLengthLocal
  254. }
  255. if (iNdEx + skippy) > l {
  256. return io.ErrUnexpectedEOF
  257. }
  258. iNdEx += skippy
  259. }
  260. }
  261. if iNdEx > l {
  262. return io.ErrUnexpectedEOF
  263. }
  264. return nil
  265. }
  266. func skipLocal(dAtA []byte) (n int, err error) {
  267. l := len(dAtA)
  268. iNdEx := 0
  269. for iNdEx < l {
  270. var wire uint64
  271. for shift := uint(0); ; shift += 7 {
  272. if shift >= 64 {
  273. return 0, ErrIntOverflowLocal
  274. }
  275. if iNdEx >= l {
  276. return 0, io.ErrUnexpectedEOF
  277. }
  278. b := dAtA[iNdEx]
  279. iNdEx++
  280. wire |= (uint64(b) & 0x7F) << shift
  281. if b < 0x80 {
  282. break
  283. }
  284. }
  285. wireType := int(wire & 0x7)
  286. switch wireType {
  287. case 0:
  288. for shift := uint(0); ; shift += 7 {
  289. if shift >= 64 {
  290. return 0, ErrIntOverflowLocal
  291. }
  292. if iNdEx >= l {
  293. return 0, io.ErrUnexpectedEOF
  294. }
  295. iNdEx++
  296. if dAtA[iNdEx-1] < 0x80 {
  297. break
  298. }
  299. }
  300. return iNdEx, nil
  301. case 1:
  302. iNdEx += 8
  303. return iNdEx, nil
  304. case 2:
  305. var length int
  306. for shift := uint(0); ; shift += 7 {
  307. if shift >= 64 {
  308. return 0, ErrIntOverflowLocal
  309. }
  310. if iNdEx >= l {
  311. return 0, io.ErrUnexpectedEOF
  312. }
  313. b := dAtA[iNdEx]
  314. iNdEx++
  315. length |= (int(b) & 0x7F) << shift
  316. if b < 0x80 {
  317. break
  318. }
  319. }
  320. iNdEx += length
  321. if length < 0 {
  322. return 0, ErrInvalidLengthLocal
  323. }
  324. return iNdEx, nil
  325. case 3:
  326. for {
  327. var innerWire uint64
  328. var start int = iNdEx
  329. for shift := uint(0); ; shift += 7 {
  330. if shift >= 64 {
  331. return 0, ErrIntOverflowLocal
  332. }
  333. if iNdEx >= l {
  334. return 0, io.ErrUnexpectedEOF
  335. }
  336. b := dAtA[iNdEx]
  337. iNdEx++
  338. innerWire |= (uint64(b) & 0x7F) << shift
  339. if b < 0x80 {
  340. break
  341. }
  342. }
  343. innerWireType := int(innerWire & 0x7)
  344. if innerWireType == 4 {
  345. break
  346. }
  347. next, err := skipLocal(dAtA[start:])
  348. if err != nil {
  349. return 0, err
  350. }
  351. iNdEx = start + next
  352. }
  353. return iNdEx, nil
  354. case 4:
  355. return iNdEx, nil
  356. case 5:
  357. iNdEx += 4
  358. return iNdEx, nil
  359. default:
  360. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  361. }
  362. }
  363. panic("unreachable")
  364. }
  365. var (
  366. ErrInvalidLengthLocal = fmt.Errorf("proto: negative length found during unmarshaling")
  367. ErrIntOverflowLocal = fmt.Errorf("proto: integer overflow")
  368. )
  369. func init() { proto.RegisterFile("local.proto", fileDescriptorLocal) }
  370. var fileDescriptorLocal = []byte{
  371. // 241 bytes of a gzipped FileDescriptorProto
  372. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8e, 0x4f, 0x4e, 0x84, 0x30,
  373. 0x14, 0xc6, 0x29, 0x24, 0x66, 0xa6, 0x63, 0x5c, 0x10, 0x17, 0xc4, 0x98, 0x42, 0x5c, 0xb1, 0x11,
  374. 0x16, 0x7a, 0x01, 0x09, 0x9b, 0x6e, 0xb9, 0x80, 0x81, 0xb6, 0x32, 0x2f, 0xc1, 0x3e, 0x43, 0x61,
  375. 0x12, 0x6f, 0xe3, 0x05, 0xbc, 0x07, 0x4b, 0xd7, 0x2e, 0x1a, 0xad, 0x17, 0x31, 0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 0x13, 0x14, 0x01, 0x00,
  387. 0x00,
  388. }