local.pb.go 10 KB

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