local.pb.go 10 KB

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