local.pb.go 10 KB

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