structs.pb.go 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: structs.proto
  3. /*
  4. Package db is a generated protocol buffer package.
  5. It is generated from these files:
  6. structs.proto
  7. It has these top-level messages:
  8. FileVersion
  9. VersionList
  10. FileInfoTruncated
  11. Counts
  12. CountsSet
  13. */
  14. package db
  15. import proto "github.com/gogo/protobuf/proto"
  16. import fmt "fmt"
  17. import math "math"
  18. import _ "github.com/gogo/protobuf/gogoproto"
  19. import protocol "github.com/syncthing/syncthing/lib/protocol"
  20. import github_com_syncthing_syncthing_lib_protocol "github.com/syncthing/syncthing/lib/protocol"
  21. import io "io"
  22. // Reference imports to suppress errors if they are not otherwise used.
  23. var _ = proto.Marshal
  24. var _ = fmt.Errorf
  25. var _ = math.Inf
  26. // This is a compile-time assertion to ensure that this generated file
  27. // is compatible with the proto package it is being compiled against.
  28. // A compilation error at this line likely means your copy of the
  29. // proto package needs to be updated.
  30. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  31. type FileVersion struct {
  32. Version protocol.Vector `protobuf:"bytes,1,opt,name=version" json:"version"`
  33. Device []byte `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"`
  34. Invalid bool `protobuf:"varint,3,opt,name=invalid,proto3" json:"invalid,omitempty"`
  35. }
  36. func (m *FileVersion) Reset() { *m = FileVersion{} }
  37. func (m *FileVersion) String() string { return proto.CompactTextString(m) }
  38. func (*FileVersion) ProtoMessage() {}
  39. func (*FileVersion) Descriptor() ([]byte, []int) { return fileDescriptorStructs, []int{0} }
  40. type VersionList struct {
  41. Versions []FileVersion `protobuf:"bytes,1,rep,name=versions" json:"versions"`
  42. }
  43. func (m *VersionList) Reset() { *m = VersionList{} }
  44. func (*VersionList) ProtoMessage() {}
  45. func (*VersionList) Descriptor() ([]byte, []int) { return fileDescriptorStructs, []int{1} }
  46. // Must be the same as FileInfo but without the blocks field
  47. type FileInfoTruncated struct {
  48. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  49. Type protocol.FileInfoType `protobuf:"varint,2,opt,name=type,proto3,enum=protocol.FileInfoType" json:"type,omitempty"`
  50. Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
  51. Permissions uint32 `protobuf:"varint,4,opt,name=permissions,proto3" json:"permissions,omitempty"`
  52. ModifiedS int64 `protobuf:"varint,5,opt,name=modified_s,json=modifiedS,proto3" json:"modified_s,omitempty"`
  53. ModifiedNs int32 `protobuf:"varint,11,opt,name=modified_ns,json=modifiedNs,proto3" json:"modified_ns,omitempty"`
  54. ModifiedBy github_com_syncthing_syncthing_lib_protocol.ShortID `protobuf:"varint,12,opt,name=modified_by,json=modifiedBy,proto3,customtype=github.com/syncthing/syncthing/lib/protocol.ShortID" json:"modified_by"`
  55. Deleted bool `protobuf:"varint,6,opt,name=deleted,proto3" json:"deleted,omitempty"`
  56. Invalid bool `protobuf:"varint,7,opt,name=invalid,proto3" json:"invalid,omitempty"`
  57. NoPermissions bool `protobuf:"varint,8,opt,name=no_permissions,json=noPermissions,proto3" json:"no_permissions,omitempty"`
  58. Version protocol.Vector `protobuf:"bytes,9,opt,name=version" json:"version"`
  59. Sequence int64 `protobuf:"varint,10,opt,name=sequence,proto3" json:"sequence,omitempty"`
  60. RawBlockSize int32 `protobuf:"varint,13,opt,name=block_size,json=blockSize,proto3" json:"block_size,omitempty"`
  61. // repeated BlockInfo Blocks = 16
  62. SymlinkTarget string `protobuf:"bytes,17,opt,name=symlink_target,json=symlinkTarget,proto3" json:"symlink_target,omitempty"`
  63. }
  64. func (m *FileInfoTruncated) Reset() { *m = FileInfoTruncated{} }
  65. func (*FileInfoTruncated) ProtoMessage() {}
  66. func (*FileInfoTruncated) Descriptor() ([]byte, []int) { return fileDescriptorStructs, []int{2} }
  67. // For each folder and device we keep one of these to track the current
  68. // counts and sequence. We also keep one for the global state of the folder.
  69. type Counts struct {
  70. Files int32 `protobuf:"varint,1,opt,name=files,proto3" json:"files,omitempty"`
  71. Directories int32 `protobuf:"varint,2,opt,name=directories,proto3" json:"directories,omitempty"`
  72. Symlinks int32 `protobuf:"varint,3,opt,name=symlinks,proto3" json:"symlinks,omitempty"`
  73. Deleted int32 `protobuf:"varint,4,opt,name=deleted,proto3" json:"deleted,omitempty"`
  74. Bytes int64 `protobuf:"varint,5,opt,name=bytes,proto3" json:"bytes,omitempty"`
  75. Sequence int64 `protobuf:"varint,6,opt,name=sequence,proto3" json:"sequence,omitempty"`
  76. DeviceID []byte `protobuf:"bytes,17,opt,name=deviceID,proto3" json:"deviceID,omitempty"`
  77. }
  78. func (m *Counts) Reset() { *m = Counts{} }
  79. func (m *Counts) String() string { return proto.CompactTextString(m) }
  80. func (*Counts) ProtoMessage() {}
  81. func (*Counts) Descriptor() ([]byte, []int) { return fileDescriptorStructs, []int{3} }
  82. type CountsSet struct {
  83. Counts []Counts `protobuf:"bytes,1,rep,name=counts" json:"counts"`
  84. Created int64 `protobuf:"varint,2,opt,name=created,proto3" json:"created,omitempty"`
  85. }
  86. func (m *CountsSet) Reset() { *m = CountsSet{} }
  87. func (m *CountsSet) String() string { return proto.CompactTextString(m) }
  88. func (*CountsSet) ProtoMessage() {}
  89. func (*CountsSet) Descriptor() ([]byte, []int) { return fileDescriptorStructs, []int{4} }
  90. func init() {
  91. proto.RegisterType((*FileVersion)(nil), "db.FileVersion")
  92. proto.RegisterType((*VersionList)(nil), "db.VersionList")
  93. proto.RegisterType((*FileInfoTruncated)(nil), "db.FileInfoTruncated")
  94. proto.RegisterType((*Counts)(nil), "db.Counts")
  95. proto.RegisterType((*CountsSet)(nil), "db.CountsSet")
  96. }
  97. func (m *FileVersion) Marshal() (dAtA []byte, err error) {
  98. size := m.ProtoSize()
  99. dAtA = make([]byte, size)
  100. n, err := m.MarshalTo(dAtA)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return dAtA[:n], nil
  105. }
  106. func (m *FileVersion) MarshalTo(dAtA []byte) (int, error) {
  107. var i int
  108. _ = i
  109. var l int
  110. _ = l
  111. dAtA[i] = 0xa
  112. i++
  113. i = encodeVarintStructs(dAtA, i, uint64(m.Version.ProtoSize()))
  114. n1, err := m.Version.MarshalTo(dAtA[i:])
  115. if err != nil {
  116. return 0, err
  117. }
  118. i += n1
  119. if len(m.Device) > 0 {
  120. dAtA[i] = 0x12
  121. i++
  122. i = encodeVarintStructs(dAtA, i, uint64(len(m.Device)))
  123. i += copy(dAtA[i:], m.Device)
  124. }
  125. if m.Invalid {
  126. dAtA[i] = 0x18
  127. i++
  128. if m.Invalid {
  129. dAtA[i] = 1
  130. } else {
  131. dAtA[i] = 0
  132. }
  133. i++
  134. }
  135. return i, nil
  136. }
  137. func (m *VersionList) Marshal() (dAtA []byte, err error) {
  138. size := m.ProtoSize()
  139. dAtA = make([]byte, size)
  140. n, err := m.MarshalTo(dAtA)
  141. if err != nil {
  142. return nil, err
  143. }
  144. return dAtA[:n], nil
  145. }
  146. func (m *VersionList) MarshalTo(dAtA []byte) (int, error) {
  147. var i int
  148. _ = i
  149. var l int
  150. _ = l
  151. if len(m.Versions) > 0 {
  152. for _, msg := range m.Versions {
  153. dAtA[i] = 0xa
  154. i++
  155. i = encodeVarintStructs(dAtA, i, uint64(msg.ProtoSize()))
  156. n, err := msg.MarshalTo(dAtA[i:])
  157. if err != nil {
  158. return 0, err
  159. }
  160. i += n
  161. }
  162. }
  163. return i, nil
  164. }
  165. func (m *FileInfoTruncated) Marshal() (dAtA []byte, err error) {
  166. size := m.ProtoSize()
  167. dAtA = make([]byte, size)
  168. n, err := m.MarshalTo(dAtA)
  169. if err != nil {
  170. return nil, err
  171. }
  172. return dAtA[:n], nil
  173. }
  174. func (m *FileInfoTruncated) MarshalTo(dAtA []byte) (int, error) {
  175. var i int
  176. _ = i
  177. var l int
  178. _ = l
  179. if len(m.Name) > 0 {
  180. dAtA[i] = 0xa
  181. i++
  182. i = encodeVarintStructs(dAtA, i, uint64(len(m.Name)))
  183. i += copy(dAtA[i:], m.Name)
  184. }
  185. if m.Type != 0 {
  186. dAtA[i] = 0x10
  187. i++
  188. i = encodeVarintStructs(dAtA, i, uint64(m.Type))
  189. }
  190. if m.Size != 0 {
  191. dAtA[i] = 0x18
  192. i++
  193. i = encodeVarintStructs(dAtA, i, uint64(m.Size))
  194. }
  195. if m.Permissions != 0 {
  196. dAtA[i] = 0x20
  197. i++
  198. i = encodeVarintStructs(dAtA, i, uint64(m.Permissions))
  199. }
  200. if m.ModifiedS != 0 {
  201. dAtA[i] = 0x28
  202. i++
  203. i = encodeVarintStructs(dAtA, i, uint64(m.ModifiedS))
  204. }
  205. if m.Deleted {
  206. dAtA[i] = 0x30
  207. i++
  208. if m.Deleted {
  209. dAtA[i] = 1
  210. } else {
  211. dAtA[i] = 0
  212. }
  213. i++
  214. }
  215. if m.Invalid {
  216. dAtA[i] = 0x38
  217. i++
  218. if m.Invalid {
  219. dAtA[i] = 1
  220. } else {
  221. dAtA[i] = 0
  222. }
  223. i++
  224. }
  225. if m.NoPermissions {
  226. dAtA[i] = 0x40
  227. i++
  228. if m.NoPermissions {
  229. dAtA[i] = 1
  230. } else {
  231. dAtA[i] = 0
  232. }
  233. i++
  234. }
  235. dAtA[i] = 0x4a
  236. i++
  237. i = encodeVarintStructs(dAtA, i, uint64(m.Version.ProtoSize()))
  238. n2, err := m.Version.MarshalTo(dAtA[i:])
  239. if err != nil {
  240. return 0, err
  241. }
  242. i += n2
  243. if m.Sequence != 0 {
  244. dAtA[i] = 0x50
  245. i++
  246. i = encodeVarintStructs(dAtA, i, uint64(m.Sequence))
  247. }
  248. if m.ModifiedNs != 0 {
  249. dAtA[i] = 0x58
  250. i++
  251. i = encodeVarintStructs(dAtA, i, uint64(m.ModifiedNs))
  252. }
  253. if m.ModifiedBy != 0 {
  254. dAtA[i] = 0x60
  255. i++
  256. i = encodeVarintStructs(dAtA, i, uint64(m.ModifiedBy))
  257. }
  258. if m.RawBlockSize != 0 {
  259. dAtA[i] = 0x68
  260. i++
  261. i = encodeVarintStructs(dAtA, i, uint64(m.RawBlockSize))
  262. }
  263. if len(m.SymlinkTarget) > 0 {
  264. dAtA[i] = 0x8a
  265. i++
  266. dAtA[i] = 0x1
  267. i++
  268. i = encodeVarintStructs(dAtA, i, uint64(len(m.SymlinkTarget)))
  269. i += copy(dAtA[i:], m.SymlinkTarget)
  270. }
  271. return i, nil
  272. }
  273. func (m *Counts) Marshal() (dAtA []byte, err error) {
  274. size := m.ProtoSize()
  275. dAtA = make([]byte, size)
  276. n, err := m.MarshalTo(dAtA)
  277. if err != nil {
  278. return nil, err
  279. }
  280. return dAtA[:n], nil
  281. }
  282. func (m *Counts) MarshalTo(dAtA []byte) (int, error) {
  283. var i int
  284. _ = i
  285. var l int
  286. _ = l
  287. if m.Files != 0 {
  288. dAtA[i] = 0x8
  289. i++
  290. i = encodeVarintStructs(dAtA, i, uint64(m.Files))
  291. }
  292. if m.Directories != 0 {
  293. dAtA[i] = 0x10
  294. i++
  295. i = encodeVarintStructs(dAtA, i, uint64(m.Directories))
  296. }
  297. if m.Symlinks != 0 {
  298. dAtA[i] = 0x18
  299. i++
  300. i = encodeVarintStructs(dAtA, i, uint64(m.Symlinks))
  301. }
  302. if m.Deleted != 0 {
  303. dAtA[i] = 0x20
  304. i++
  305. i = encodeVarintStructs(dAtA, i, uint64(m.Deleted))
  306. }
  307. if m.Bytes != 0 {
  308. dAtA[i] = 0x28
  309. i++
  310. i = encodeVarintStructs(dAtA, i, uint64(m.Bytes))
  311. }
  312. if m.Sequence != 0 {
  313. dAtA[i] = 0x30
  314. i++
  315. i = encodeVarintStructs(dAtA, i, uint64(m.Sequence))
  316. }
  317. if len(m.DeviceID) > 0 {
  318. dAtA[i] = 0x8a
  319. i++
  320. dAtA[i] = 0x1
  321. i++
  322. i = encodeVarintStructs(dAtA, i, uint64(len(m.DeviceID)))
  323. i += copy(dAtA[i:], m.DeviceID)
  324. }
  325. return i, nil
  326. }
  327. func (m *CountsSet) Marshal() (dAtA []byte, err error) {
  328. size := m.ProtoSize()
  329. dAtA = make([]byte, size)
  330. n, err := m.MarshalTo(dAtA)
  331. if err != nil {
  332. return nil, err
  333. }
  334. return dAtA[:n], nil
  335. }
  336. func (m *CountsSet) MarshalTo(dAtA []byte) (int, error) {
  337. var i int
  338. _ = i
  339. var l int
  340. _ = l
  341. if len(m.Counts) > 0 {
  342. for _, msg := range m.Counts {
  343. dAtA[i] = 0xa
  344. i++
  345. i = encodeVarintStructs(dAtA, i, uint64(msg.ProtoSize()))
  346. n, err := msg.MarshalTo(dAtA[i:])
  347. if err != nil {
  348. return 0, err
  349. }
  350. i += n
  351. }
  352. }
  353. if m.Created != 0 {
  354. dAtA[i] = 0x10
  355. i++
  356. i = encodeVarintStructs(dAtA, i, uint64(m.Created))
  357. }
  358. return i, nil
  359. }
  360. func encodeFixed64Structs(dAtA []byte, offset int, v uint64) int {
  361. dAtA[offset] = uint8(v)
  362. dAtA[offset+1] = uint8(v >> 8)
  363. dAtA[offset+2] = uint8(v >> 16)
  364. dAtA[offset+3] = uint8(v >> 24)
  365. dAtA[offset+4] = uint8(v >> 32)
  366. dAtA[offset+5] = uint8(v >> 40)
  367. dAtA[offset+6] = uint8(v >> 48)
  368. dAtA[offset+7] = uint8(v >> 56)
  369. return offset + 8
  370. }
  371. func encodeFixed32Structs(dAtA []byte, offset int, v uint32) int {
  372. dAtA[offset] = uint8(v)
  373. dAtA[offset+1] = uint8(v >> 8)
  374. dAtA[offset+2] = uint8(v >> 16)
  375. dAtA[offset+3] = uint8(v >> 24)
  376. return offset + 4
  377. }
  378. func encodeVarintStructs(dAtA []byte, offset int, v uint64) int {
  379. for v >= 1<<7 {
  380. dAtA[offset] = uint8(v&0x7f | 0x80)
  381. v >>= 7
  382. offset++
  383. }
  384. dAtA[offset] = uint8(v)
  385. return offset + 1
  386. }
  387. func (m *FileVersion) ProtoSize() (n int) {
  388. var l int
  389. _ = l
  390. l = m.Version.ProtoSize()
  391. n += 1 + l + sovStructs(uint64(l))
  392. l = len(m.Device)
  393. if l > 0 {
  394. n += 1 + l + sovStructs(uint64(l))
  395. }
  396. if m.Invalid {
  397. n += 2
  398. }
  399. return n
  400. }
  401. func (m *VersionList) ProtoSize() (n int) {
  402. var l int
  403. _ = l
  404. if len(m.Versions) > 0 {
  405. for _, e := range m.Versions {
  406. l = e.ProtoSize()
  407. n += 1 + l + sovStructs(uint64(l))
  408. }
  409. }
  410. return n
  411. }
  412. func (m *FileInfoTruncated) ProtoSize() (n int) {
  413. var l int
  414. _ = l
  415. l = len(m.Name)
  416. if l > 0 {
  417. n += 1 + l + sovStructs(uint64(l))
  418. }
  419. if m.Type != 0 {
  420. n += 1 + sovStructs(uint64(m.Type))
  421. }
  422. if m.Size != 0 {
  423. n += 1 + sovStructs(uint64(m.Size))
  424. }
  425. if m.Permissions != 0 {
  426. n += 1 + sovStructs(uint64(m.Permissions))
  427. }
  428. if m.ModifiedS != 0 {
  429. n += 1 + sovStructs(uint64(m.ModifiedS))
  430. }
  431. if m.Deleted {
  432. n += 2
  433. }
  434. if m.Invalid {
  435. n += 2
  436. }
  437. if m.NoPermissions {
  438. n += 2
  439. }
  440. l = m.Version.ProtoSize()
  441. n += 1 + l + sovStructs(uint64(l))
  442. if m.Sequence != 0 {
  443. n += 1 + sovStructs(uint64(m.Sequence))
  444. }
  445. if m.ModifiedNs != 0 {
  446. n += 1 + sovStructs(uint64(m.ModifiedNs))
  447. }
  448. if m.ModifiedBy != 0 {
  449. n += 1 + sovStructs(uint64(m.ModifiedBy))
  450. }
  451. if m.RawBlockSize != 0 {
  452. n += 1 + sovStructs(uint64(m.RawBlockSize))
  453. }
  454. l = len(m.SymlinkTarget)
  455. if l > 0 {
  456. n += 2 + l + sovStructs(uint64(l))
  457. }
  458. return n
  459. }
  460. func (m *Counts) ProtoSize() (n int) {
  461. var l int
  462. _ = l
  463. if m.Files != 0 {
  464. n += 1 + sovStructs(uint64(m.Files))
  465. }
  466. if m.Directories != 0 {
  467. n += 1 + sovStructs(uint64(m.Directories))
  468. }
  469. if m.Symlinks != 0 {
  470. n += 1 + sovStructs(uint64(m.Symlinks))
  471. }
  472. if m.Deleted != 0 {
  473. n += 1 + sovStructs(uint64(m.Deleted))
  474. }
  475. if m.Bytes != 0 {
  476. n += 1 + sovStructs(uint64(m.Bytes))
  477. }
  478. if m.Sequence != 0 {
  479. n += 1 + sovStructs(uint64(m.Sequence))
  480. }
  481. l = len(m.DeviceID)
  482. if l > 0 {
  483. n += 2 + l + sovStructs(uint64(l))
  484. }
  485. return n
  486. }
  487. func (m *CountsSet) ProtoSize() (n int) {
  488. var l int
  489. _ = l
  490. if len(m.Counts) > 0 {
  491. for _, e := range m.Counts {
  492. l = e.ProtoSize()
  493. n += 1 + l + sovStructs(uint64(l))
  494. }
  495. }
  496. if m.Created != 0 {
  497. n += 1 + sovStructs(uint64(m.Created))
  498. }
  499. return n
  500. }
  501. func sovStructs(x uint64) (n int) {
  502. for {
  503. n++
  504. x >>= 7
  505. if x == 0 {
  506. break
  507. }
  508. }
  509. return n
  510. }
  511. func sozStructs(x uint64) (n int) {
  512. return sovStructs(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  513. }
  514. func (m *FileVersion) Unmarshal(dAtA []byte) error {
  515. l := len(dAtA)
  516. iNdEx := 0
  517. for iNdEx < l {
  518. preIndex := iNdEx
  519. var wire uint64
  520. for shift := uint(0); ; shift += 7 {
  521. if shift >= 64 {
  522. return ErrIntOverflowStructs
  523. }
  524. if iNdEx >= l {
  525. return io.ErrUnexpectedEOF
  526. }
  527. b := dAtA[iNdEx]
  528. iNdEx++
  529. wire |= (uint64(b) & 0x7F) << shift
  530. if b < 0x80 {
  531. break
  532. }
  533. }
  534. fieldNum := int32(wire >> 3)
  535. wireType := int(wire & 0x7)
  536. if wireType == 4 {
  537. return fmt.Errorf("proto: FileVersion: wiretype end group for non-group")
  538. }
  539. if fieldNum <= 0 {
  540. return fmt.Errorf("proto: FileVersion: illegal tag %d (wire type %d)", fieldNum, wire)
  541. }
  542. switch fieldNum {
  543. case 1:
  544. if wireType != 2 {
  545. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  546. }
  547. var msglen int
  548. for shift := uint(0); ; shift += 7 {
  549. if shift >= 64 {
  550. return ErrIntOverflowStructs
  551. }
  552. if iNdEx >= l {
  553. return io.ErrUnexpectedEOF
  554. }
  555. b := dAtA[iNdEx]
  556. iNdEx++
  557. msglen |= (int(b) & 0x7F) << shift
  558. if b < 0x80 {
  559. break
  560. }
  561. }
  562. if msglen < 0 {
  563. return ErrInvalidLengthStructs
  564. }
  565. postIndex := iNdEx + msglen
  566. if postIndex > l {
  567. return io.ErrUnexpectedEOF
  568. }
  569. if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  570. return err
  571. }
  572. iNdEx = postIndex
  573. case 2:
  574. if wireType != 2 {
  575. return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType)
  576. }
  577. var byteLen int
  578. for shift := uint(0); ; shift += 7 {
  579. if shift >= 64 {
  580. return ErrIntOverflowStructs
  581. }
  582. if iNdEx >= l {
  583. return io.ErrUnexpectedEOF
  584. }
  585. b := dAtA[iNdEx]
  586. iNdEx++
  587. byteLen |= (int(b) & 0x7F) << shift
  588. if b < 0x80 {
  589. break
  590. }
  591. }
  592. if byteLen < 0 {
  593. return ErrInvalidLengthStructs
  594. }
  595. postIndex := iNdEx + byteLen
  596. if postIndex > l {
  597. return io.ErrUnexpectedEOF
  598. }
  599. m.Device = append(m.Device[:0], dAtA[iNdEx:postIndex]...)
  600. if m.Device == nil {
  601. m.Device = []byte{}
  602. }
  603. iNdEx = postIndex
  604. case 3:
  605. if wireType != 0 {
  606. return fmt.Errorf("proto: wrong wireType = %d for field Invalid", wireType)
  607. }
  608. var v int
  609. for shift := uint(0); ; shift += 7 {
  610. if shift >= 64 {
  611. return ErrIntOverflowStructs
  612. }
  613. if iNdEx >= l {
  614. return io.ErrUnexpectedEOF
  615. }
  616. b := dAtA[iNdEx]
  617. iNdEx++
  618. v |= (int(b) & 0x7F) << shift
  619. if b < 0x80 {
  620. break
  621. }
  622. }
  623. m.Invalid = bool(v != 0)
  624. default:
  625. iNdEx = preIndex
  626. skippy, err := skipStructs(dAtA[iNdEx:])
  627. if err != nil {
  628. return err
  629. }
  630. if skippy < 0 {
  631. return ErrInvalidLengthStructs
  632. }
  633. if (iNdEx + skippy) > l {
  634. return io.ErrUnexpectedEOF
  635. }
  636. iNdEx += skippy
  637. }
  638. }
  639. if iNdEx > l {
  640. return io.ErrUnexpectedEOF
  641. }
  642. return nil
  643. }
  644. func (m *VersionList) Unmarshal(dAtA []byte) error {
  645. l := len(dAtA)
  646. iNdEx := 0
  647. for iNdEx < l {
  648. preIndex := iNdEx
  649. var wire uint64
  650. for shift := uint(0); ; shift += 7 {
  651. if shift >= 64 {
  652. return ErrIntOverflowStructs
  653. }
  654. if iNdEx >= l {
  655. return io.ErrUnexpectedEOF
  656. }
  657. b := dAtA[iNdEx]
  658. iNdEx++
  659. wire |= (uint64(b) & 0x7F) << shift
  660. if b < 0x80 {
  661. break
  662. }
  663. }
  664. fieldNum := int32(wire >> 3)
  665. wireType := int(wire & 0x7)
  666. if wireType == 4 {
  667. return fmt.Errorf("proto: VersionList: wiretype end group for non-group")
  668. }
  669. if fieldNum <= 0 {
  670. return fmt.Errorf("proto: VersionList: illegal tag %d (wire type %d)", fieldNum, wire)
  671. }
  672. switch fieldNum {
  673. case 1:
  674. if wireType != 2 {
  675. return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType)
  676. }
  677. var msglen int
  678. for shift := uint(0); ; shift += 7 {
  679. if shift >= 64 {
  680. return ErrIntOverflowStructs
  681. }
  682. if iNdEx >= l {
  683. return io.ErrUnexpectedEOF
  684. }
  685. b := dAtA[iNdEx]
  686. iNdEx++
  687. msglen |= (int(b) & 0x7F) << shift
  688. if b < 0x80 {
  689. break
  690. }
  691. }
  692. if msglen < 0 {
  693. return ErrInvalidLengthStructs
  694. }
  695. postIndex := iNdEx + msglen
  696. if postIndex > l {
  697. return io.ErrUnexpectedEOF
  698. }
  699. m.Versions = append(m.Versions, FileVersion{})
  700. if err := m.Versions[len(m.Versions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  701. return err
  702. }
  703. iNdEx = postIndex
  704. default:
  705. iNdEx = preIndex
  706. skippy, err := skipStructs(dAtA[iNdEx:])
  707. if err != nil {
  708. return err
  709. }
  710. if skippy < 0 {
  711. return ErrInvalidLengthStructs
  712. }
  713. if (iNdEx + skippy) > l {
  714. return io.ErrUnexpectedEOF
  715. }
  716. iNdEx += skippy
  717. }
  718. }
  719. if iNdEx > l {
  720. return io.ErrUnexpectedEOF
  721. }
  722. return nil
  723. }
  724. func (m *FileInfoTruncated) Unmarshal(dAtA []byte) error {
  725. l := len(dAtA)
  726. iNdEx := 0
  727. for iNdEx < l {
  728. preIndex := iNdEx
  729. var wire uint64
  730. for shift := uint(0); ; shift += 7 {
  731. if shift >= 64 {
  732. return ErrIntOverflowStructs
  733. }
  734. if iNdEx >= l {
  735. return io.ErrUnexpectedEOF
  736. }
  737. b := dAtA[iNdEx]
  738. iNdEx++
  739. wire |= (uint64(b) & 0x7F) << shift
  740. if b < 0x80 {
  741. break
  742. }
  743. }
  744. fieldNum := int32(wire >> 3)
  745. wireType := int(wire & 0x7)
  746. if wireType == 4 {
  747. return fmt.Errorf("proto: FileInfoTruncated: wiretype end group for non-group")
  748. }
  749. if fieldNum <= 0 {
  750. return fmt.Errorf("proto: FileInfoTruncated: illegal tag %d (wire type %d)", fieldNum, wire)
  751. }
  752. switch fieldNum {
  753. case 1:
  754. if wireType != 2 {
  755. return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
  756. }
  757. var stringLen uint64
  758. for shift := uint(0); ; shift += 7 {
  759. if shift >= 64 {
  760. return ErrIntOverflowStructs
  761. }
  762. if iNdEx >= l {
  763. return io.ErrUnexpectedEOF
  764. }
  765. b := dAtA[iNdEx]
  766. iNdEx++
  767. stringLen |= (uint64(b) & 0x7F) << shift
  768. if b < 0x80 {
  769. break
  770. }
  771. }
  772. intStringLen := int(stringLen)
  773. if intStringLen < 0 {
  774. return ErrInvalidLengthStructs
  775. }
  776. postIndex := iNdEx + intStringLen
  777. if postIndex > l {
  778. return io.ErrUnexpectedEOF
  779. }
  780. m.Name = string(dAtA[iNdEx:postIndex])
  781. iNdEx = postIndex
  782. case 2:
  783. if wireType != 0 {
  784. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  785. }
  786. m.Type = 0
  787. for shift := uint(0); ; shift += 7 {
  788. if shift >= 64 {
  789. return ErrIntOverflowStructs
  790. }
  791. if iNdEx >= l {
  792. return io.ErrUnexpectedEOF
  793. }
  794. b := dAtA[iNdEx]
  795. iNdEx++
  796. m.Type |= (protocol.FileInfoType(b) & 0x7F) << shift
  797. if b < 0x80 {
  798. break
  799. }
  800. }
  801. case 3:
  802. if wireType != 0 {
  803. return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType)
  804. }
  805. m.Size = 0
  806. for shift := uint(0); ; shift += 7 {
  807. if shift >= 64 {
  808. return ErrIntOverflowStructs
  809. }
  810. if iNdEx >= l {
  811. return io.ErrUnexpectedEOF
  812. }
  813. b := dAtA[iNdEx]
  814. iNdEx++
  815. m.Size |= (int64(b) & 0x7F) << shift
  816. if b < 0x80 {
  817. break
  818. }
  819. }
  820. case 4:
  821. if wireType != 0 {
  822. return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType)
  823. }
  824. m.Permissions = 0
  825. for shift := uint(0); ; shift += 7 {
  826. if shift >= 64 {
  827. return ErrIntOverflowStructs
  828. }
  829. if iNdEx >= l {
  830. return io.ErrUnexpectedEOF
  831. }
  832. b := dAtA[iNdEx]
  833. iNdEx++
  834. m.Permissions |= (uint32(b) & 0x7F) << shift
  835. if b < 0x80 {
  836. break
  837. }
  838. }
  839. case 5:
  840. if wireType != 0 {
  841. return fmt.Errorf("proto: wrong wireType = %d for field ModifiedS", wireType)
  842. }
  843. m.ModifiedS = 0
  844. for shift := uint(0); ; shift += 7 {
  845. if shift >= 64 {
  846. return ErrIntOverflowStructs
  847. }
  848. if iNdEx >= l {
  849. return io.ErrUnexpectedEOF
  850. }
  851. b := dAtA[iNdEx]
  852. iNdEx++
  853. m.ModifiedS |= (int64(b) & 0x7F) << shift
  854. if b < 0x80 {
  855. break
  856. }
  857. }
  858. case 6:
  859. if wireType != 0 {
  860. return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType)
  861. }
  862. var v int
  863. for shift := uint(0); ; shift += 7 {
  864. if shift >= 64 {
  865. return ErrIntOverflowStructs
  866. }
  867. if iNdEx >= l {
  868. return io.ErrUnexpectedEOF
  869. }
  870. b := dAtA[iNdEx]
  871. iNdEx++
  872. v |= (int(b) & 0x7F) << shift
  873. if b < 0x80 {
  874. break
  875. }
  876. }
  877. m.Deleted = bool(v != 0)
  878. case 7:
  879. if wireType != 0 {
  880. return fmt.Errorf("proto: wrong wireType = %d for field Invalid", wireType)
  881. }
  882. var v int
  883. for shift := uint(0); ; shift += 7 {
  884. if shift >= 64 {
  885. return ErrIntOverflowStructs
  886. }
  887. if iNdEx >= l {
  888. return io.ErrUnexpectedEOF
  889. }
  890. b := dAtA[iNdEx]
  891. iNdEx++
  892. v |= (int(b) & 0x7F) << shift
  893. if b < 0x80 {
  894. break
  895. }
  896. }
  897. m.Invalid = bool(v != 0)
  898. case 8:
  899. if wireType != 0 {
  900. return fmt.Errorf("proto: wrong wireType = %d for field NoPermissions", wireType)
  901. }
  902. var v int
  903. for shift := uint(0); ; shift += 7 {
  904. if shift >= 64 {
  905. return ErrIntOverflowStructs
  906. }
  907. if iNdEx >= l {
  908. return io.ErrUnexpectedEOF
  909. }
  910. b := dAtA[iNdEx]
  911. iNdEx++
  912. v |= (int(b) & 0x7F) << shift
  913. if b < 0x80 {
  914. break
  915. }
  916. }
  917. m.NoPermissions = bool(v != 0)
  918. case 9:
  919. if wireType != 2 {
  920. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  921. }
  922. var msglen int
  923. for shift := uint(0); ; shift += 7 {
  924. if shift >= 64 {
  925. return ErrIntOverflowStructs
  926. }
  927. if iNdEx >= l {
  928. return io.ErrUnexpectedEOF
  929. }
  930. b := dAtA[iNdEx]
  931. iNdEx++
  932. msglen |= (int(b) & 0x7F) << shift
  933. if b < 0x80 {
  934. break
  935. }
  936. }
  937. if msglen < 0 {
  938. return ErrInvalidLengthStructs
  939. }
  940. postIndex := iNdEx + msglen
  941. if postIndex > l {
  942. return io.ErrUnexpectedEOF
  943. }
  944. if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  945. return err
  946. }
  947. iNdEx = postIndex
  948. case 10:
  949. if wireType != 0 {
  950. return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType)
  951. }
  952. m.Sequence = 0
  953. for shift := uint(0); ; shift += 7 {
  954. if shift >= 64 {
  955. return ErrIntOverflowStructs
  956. }
  957. if iNdEx >= l {
  958. return io.ErrUnexpectedEOF
  959. }
  960. b := dAtA[iNdEx]
  961. iNdEx++
  962. m.Sequence |= (int64(b) & 0x7F) << shift
  963. if b < 0x80 {
  964. break
  965. }
  966. }
  967. case 11:
  968. if wireType != 0 {
  969. return fmt.Errorf("proto: wrong wireType = %d for field ModifiedNs", wireType)
  970. }
  971. m.ModifiedNs = 0
  972. for shift := uint(0); ; shift += 7 {
  973. if shift >= 64 {
  974. return ErrIntOverflowStructs
  975. }
  976. if iNdEx >= l {
  977. return io.ErrUnexpectedEOF
  978. }
  979. b := dAtA[iNdEx]
  980. iNdEx++
  981. m.ModifiedNs |= (int32(b) & 0x7F) << shift
  982. if b < 0x80 {
  983. break
  984. }
  985. }
  986. case 12:
  987. if wireType != 0 {
  988. return fmt.Errorf("proto: wrong wireType = %d for field ModifiedBy", wireType)
  989. }
  990. m.ModifiedBy = 0
  991. for shift := uint(0); ; shift += 7 {
  992. if shift >= 64 {
  993. return ErrIntOverflowStructs
  994. }
  995. if iNdEx >= l {
  996. return io.ErrUnexpectedEOF
  997. }
  998. b := dAtA[iNdEx]
  999. iNdEx++
  1000. m.ModifiedBy |= (github_com_syncthing_syncthing_lib_protocol.ShortID(b) & 0x7F) << shift
  1001. if b < 0x80 {
  1002. break
  1003. }
  1004. }
  1005. case 13:
  1006. if wireType != 0 {
  1007. return fmt.Errorf("proto: wrong wireType = %d for field RawBlockSize", wireType)
  1008. }
  1009. m.RawBlockSize = 0
  1010. for shift := uint(0); ; shift += 7 {
  1011. if shift >= 64 {
  1012. return ErrIntOverflowStructs
  1013. }
  1014. if iNdEx >= l {
  1015. return io.ErrUnexpectedEOF
  1016. }
  1017. b := dAtA[iNdEx]
  1018. iNdEx++
  1019. m.RawBlockSize |= (int32(b) & 0x7F) << shift
  1020. if b < 0x80 {
  1021. break
  1022. }
  1023. }
  1024. case 17:
  1025. if wireType != 2 {
  1026. return fmt.Errorf("proto: wrong wireType = %d for field SymlinkTarget", wireType)
  1027. }
  1028. var stringLen uint64
  1029. for shift := uint(0); ; shift += 7 {
  1030. if shift >= 64 {
  1031. return ErrIntOverflowStructs
  1032. }
  1033. if iNdEx >= l {
  1034. return io.ErrUnexpectedEOF
  1035. }
  1036. b := dAtA[iNdEx]
  1037. iNdEx++
  1038. stringLen |= (uint64(b) & 0x7F) << shift
  1039. if b < 0x80 {
  1040. break
  1041. }
  1042. }
  1043. intStringLen := int(stringLen)
  1044. if intStringLen < 0 {
  1045. return ErrInvalidLengthStructs
  1046. }
  1047. postIndex := iNdEx + intStringLen
  1048. if postIndex > l {
  1049. return io.ErrUnexpectedEOF
  1050. }
  1051. m.SymlinkTarget = string(dAtA[iNdEx:postIndex])
  1052. iNdEx = postIndex
  1053. default:
  1054. iNdEx = preIndex
  1055. skippy, err := skipStructs(dAtA[iNdEx:])
  1056. if err != nil {
  1057. return err
  1058. }
  1059. if skippy < 0 {
  1060. return ErrInvalidLengthStructs
  1061. }
  1062. if (iNdEx + skippy) > l {
  1063. return io.ErrUnexpectedEOF
  1064. }
  1065. iNdEx += skippy
  1066. }
  1067. }
  1068. if iNdEx > l {
  1069. return io.ErrUnexpectedEOF
  1070. }
  1071. return nil
  1072. }
  1073. func (m *Counts) Unmarshal(dAtA []byte) error {
  1074. l := len(dAtA)
  1075. iNdEx := 0
  1076. for iNdEx < l {
  1077. preIndex := iNdEx
  1078. var wire uint64
  1079. for shift := uint(0); ; shift += 7 {
  1080. if shift >= 64 {
  1081. return ErrIntOverflowStructs
  1082. }
  1083. if iNdEx >= l {
  1084. return io.ErrUnexpectedEOF
  1085. }
  1086. b := dAtA[iNdEx]
  1087. iNdEx++
  1088. wire |= (uint64(b) & 0x7F) << shift
  1089. if b < 0x80 {
  1090. break
  1091. }
  1092. }
  1093. fieldNum := int32(wire >> 3)
  1094. wireType := int(wire & 0x7)
  1095. if wireType == 4 {
  1096. return fmt.Errorf("proto: Counts: wiretype end group for non-group")
  1097. }
  1098. if fieldNum <= 0 {
  1099. return fmt.Errorf("proto: Counts: illegal tag %d (wire type %d)", fieldNum, wire)
  1100. }
  1101. switch fieldNum {
  1102. case 1:
  1103. if wireType != 0 {
  1104. return fmt.Errorf("proto: wrong wireType = %d for field Files", wireType)
  1105. }
  1106. m.Files = 0
  1107. for shift := uint(0); ; shift += 7 {
  1108. if shift >= 64 {
  1109. return ErrIntOverflowStructs
  1110. }
  1111. if iNdEx >= l {
  1112. return io.ErrUnexpectedEOF
  1113. }
  1114. b := dAtA[iNdEx]
  1115. iNdEx++
  1116. m.Files |= (int32(b) & 0x7F) << shift
  1117. if b < 0x80 {
  1118. break
  1119. }
  1120. }
  1121. case 2:
  1122. if wireType != 0 {
  1123. return fmt.Errorf("proto: wrong wireType = %d for field Directories", wireType)
  1124. }
  1125. m.Directories = 0
  1126. for shift := uint(0); ; shift += 7 {
  1127. if shift >= 64 {
  1128. return ErrIntOverflowStructs
  1129. }
  1130. if iNdEx >= l {
  1131. return io.ErrUnexpectedEOF
  1132. }
  1133. b := dAtA[iNdEx]
  1134. iNdEx++
  1135. m.Directories |= (int32(b) & 0x7F) << shift
  1136. if b < 0x80 {
  1137. break
  1138. }
  1139. }
  1140. case 3:
  1141. if wireType != 0 {
  1142. return fmt.Errorf("proto: wrong wireType = %d for field Symlinks", wireType)
  1143. }
  1144. m.Symlinks = 0
  1145. for shift := uint(0); ; shift += 7 {
  1146. if shift >= 64 {
  1147. return ErrIntOverflowStructs
  1148. }
  1149. if iNdEx >= l {
  1150. return io.ErrUnexpectedEOF
  1151. }
  1152. b := dAtA[iNdEx]
  1153. iNdEx++
  1154. m.Symlinks |= (int32(b) & 0x7F) << shift
  1155. if b < 0x80 {
  1156. break
  1157. }
  1158. }
  1159. case 4:
  1160. if wireType != 0 {
  1161. return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType)
  1162. }
  1163. m.Deleted = 0
  1164. for shift := uint(0); ; shift += 7 {
  1165. if shift >= 64 {
  1166. return ErrIntOverflowStructs
  1167. }
  1168. if iNdEx >= l {
  1169. return io.ErrUnexpectedEOF
  1170. }
  1171. b := dAtA[iNdEx]
  1172. iNdEx++
  1173. m.Deleted |= (int32(b) & 0x7F) << shift
  1174. if b < 0x80 {
  1175. break
  1176. }
  1177. }
  1178. case 5:
  1179. if wireType != 0 {
  1180. return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType)
  1181. }
  1182. m.Bytes = 0
  1183. for shift := uint(0); ; shift += 7 {
  1184. if shift >= 64 {
  1185. return ErrIntOverflowStructs
  1186. }
  1187. if iNdEx >= l {
  1188. return io.ErrUnexpectedEOF
  1189. }
  1190. b := dAtA[iNdEx]
  1191. iNdEx++
  1192. m.Bytes |= (int64(b) & 0x7F) << shift
  1193. if b < 0x80 {
  1194. break
  1195. }
  1196. }
  1197. case 6:
  1198. if wireType != 0 {
  1199. return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType)
  1200. }
  1201. m.Sequence = 0
  1202. for shift := uint(0); ; shift += 7 {
  1203. if shift >= 64 {
  1204. return ErrIntOverflowStructs
  1205. }
  1206. if iNdEx >= l {
  1207. return io.ErrUnexpectedEOF
  1208. }
  1209. b := dAtA[iNdEx]
  1210. iNdEx++
  1211. m.Sequence |= (int64(b) & 0x7F) << shift
  1212. if b < 0x80 {
  1213. break
  1214. }
  1215. }
  1216. case 17:
  1217. if wireType != 2 {
  1218. return fmt.Errorf("proto: wrong wireType = %d for field DeviceID", wireType)
  1219. }
  1220. var byteLen int
  1221. for shift := uint(0); ; shift += 7 {
  1222. if shift >= 64 {
  1223. return ErrIntOverflowStructs
  1224. }
  1225. if iNdEx >= l {
  1226. return io.ErrUnexpectedEOF
  1227. }
  1228. b := dAtA[iNdEx]
  1229. iNdEx++
  1230. byteLen |= (int(b) & 0x7F) << shift
  1231. if b < 0x80 {
  1232. break
  1233. }
  1234. }
  1235. if byteLen < 0 {
  1236. return ErrInvalidLengthStructs
  1237. }
  1238. postIndex := iNdEx + byteLen
  1239. if postIndex > l {
  1240. return io.ErrUnexpectedEOF
  1241. }
  1242. m.DeviceID = append(m.DeviceID[:0], dAtA[iNdEx:postIndex]...)
  1243. if m.DeviceID == nil {
  1244. m.DeviceID = []byte{}
  1245. }
  1246. iNdEx = postIndex
  1247. default:
  1248. iNdEx = preIndex
  1249. skippy, err := skipStructs(dAtA[iNdEx:])
  1250. if err != nil {
  1251. return err
  1252. }
  1253. if skippy < 0 {
  1254. return ErrInvalidLengthStructs
  1255. }
  1256. if (iNdEx + skippy) > l {
  1257. return io.ErrUnexpectedEOF
  1258. }
  1259. iNdEx += skippy
  1260. }
  1261. }
  1262. if iNdEx > l {
  1263. return io.ErrUnexpectedEOF
  1264. }
  1265. return nil
  1266. }
  1267. func (m *CountsSet) Unmarshal(dAtA []byte) error {
  1268. l := len(dAtA)
  1269. iNdEx := 0
  1270. for iNdEx < l {
  1271. preIndex := iNdEx
  1272. var wire uint64
  1273. for shift := uint(0); ; shift += 7 {
  1274. if shift >= 64 {
  1275. return ErrIntOverflowStructs
  1276. }
  1277. if iNdEx >= l {
  1278. return io.ErrUnexpectedEOF
  1279. }
  1280. b := dAtA[iNdEx]
  1281. iNdEx++
  1282. wire |= (uint64(b) & 0x7F) << shift
  1283. if b < 0x80 {
  1284. break
  1285. }
  1286. }
  1287. fieldNum := int32(wire >> 3)
  1288. wireType := int(wire & 0x7)
  1289. if wireType == 4 {
  1290. return fmt.Errorf("proto: CountsSet: wiretype end group for non-group")
  1291. }
  1292. if fieldNum <= 0 {
  1293. return fmt.Errorf("proto: CountsSet: illegal tag %d (wire type %d)", fieldNum, wire)
  1294. }
  1295. switch fieldNum {
  1296. case 1:
  1297. if wireType != 2 {
  1298. return fmt.Errorf("proto: wrong wireType = %d for field Counts", wireType)
  1299. }
  1300. var msglen int
  1301. for shift := uint(0); ; shift += 7 {
  1302. if shift >= 64 {
  1303. return ErrIntOverflowStructs
  1304. }
  1305. if iNdEx >= l {
  1306. return io.ErrUnexpectedEOF
  1307. }
  1308. b := dAtA[iNdEx]
  1309. iNdEx++
  1310. msglen |= (int(b) & 0x7F) << shift
  1311. if b < 0x80 {
  1312. break
  1313. }
  1314. }
  1315. if msglen < 0 {
  1316. return ErrInvalidLengthStructs
  1317. }
  1318. postIndex := iNdEx + msglen
  1319. if postIndex > l {
  1320. return io.ErrUnexpectedEOF
  1321. }
  1322. m.Counts = append(m.Counts, Counts{})
  1323. if err := m.Counts[len(m.Counts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1324. return err
  1325. }
  1326. iNdEx = postIndex
  1327. case 2:
  1328. if wireType != 0 {
  1329. return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType)
  1330. }
  1331. m.Created = 0
  1332. for shift := uint(0); ; shift += 7 {
  1333. if shift >= 64 {
  1334. return ErrIntOverflowStructs
  1335. }
  1336. if iNdEx >= l {
  1337. return io.ErrUnexpectedEOF
  1338. }
  1339. b := dAtA[iNdEx]
  1340. iNdEx++
  1341. m.Created |= (int64(b) & 0x7F) << shift
  1342. if b < 0x80 {
  1343. break
  1344. }
  1345. }
  1346. default:
  1347. iNdEx = preIndex
  1348. skippy, err := skipStructs(dAtA[iNdEx:])
  1349. if err != nil {
  1350. return err
  1351. }
  1352. if skippy < 0 {
  1353. return ErrInvalidLengthStructs
  1354. }
  1355. if (iNdEx + skippy) > l {
  1356. return io.ErrUnexpectedEOF
  1357. }
  1358. iNdEx += skippy
  1359. }
  1360. }
  1361. if iNdEx > l {
  1362. return io.ErrUnexpectedEOF
  1363. }
  1364. return nil
  1365. }
  1366. func skipStructs(dAtA []byte) (n int, err error) {
  1367. l := len(dAtA)
  1368. iNdEx := 0
  1369. for iNdEx < l {
  1370. var wire uint64
  1371. for shift := uint(0); ; shift += 7 {
  1372. if shift >= 64 {
  1373. return 0, ErrIntOverflowStructs
  1374. }
  1375. if iNdEx >= l {
  1376. return 0, io.ErrUnexpectedEOF
  1377. }
  1378. b := dAtA[iNdEx]
  1379. iNdEx++
  1380. wire |= (uint64(b) & 0x7F) << shift
  1381. if b < 0x80 {
  1382. break
  1383. }
  1384. }
  1385. wireType := int(wire & 0x7)
  1386. switch wireType {
  1387. case 0:
  1388. for shift := uint(0); ; shift += 7 {
  1389. if shift >= 64 {
  1390. return 0, ErrIntOverflowStructs
  1391. }
  1392. if iNdEx >= l {
  1393. return 0, io.ErrUnexpectedEOF
  1394. }
  1395. iNdEx++
  1396. if dAtA[iNdEx-1] < 0x80 {
  1397. break
  1398. }
  1399. }
  1400. return iNdEx, nil
  1401. case 1:
  1402. iNdEx += 8
  1403. return iNdEx, nil
  1404. case 2:
  1405. var length int
  1406. for shift := uint(0); ; shift += 7 {
  1407. if shift >= 64 {
  1408. return 0, ErrIntOverflowStructs
  1409. }
  1410. if iNdEx >= l {
  1411. return 0, io.ErrUnexpectedEOF
  1412. }
  1413. b := dAtA[iNdEx]
  1414. iNdEx++
  1415. length |= (int(b) & 0x7F) << shift
  1416. if b < 0x80 {
  1417. break
  1418. }
  1419. }
  1420. iNdEx += length
  1421. if length < 0 {
  1422. return 0, ErrInvalidLengthStructs
  1423. }
  1424. return iNdEx, nil
  1425. case 3:
  1426. for {
  1427. var innerWire uint64
  1428. var start int = iNdEx
  1429. for shift := uint(0); ; shift += 7 {
  1430. if shift >= 64 {
  1431. return 0, ErrIntOverflowStructs
  1432. }
  1433. if iNdEx >= l {
  1434. return 0, io.ErrUnexpectedEOF
  1435. }
  1436. b := dAtA[iNdEx]
  1437. iNdEx++
  1438. innerWire |= (uint64(b) & 0x7F) << shift
  1439. if b < 0x80 {
  1440. break
  1441. }
  1442. }
  1443. innerWireType := int(innerWire & 0x7)
  1444. if innerWireType == 4 {
  1445. break
  1446. }
  1447. next, err := skipStructs(dAtA[start:])
  1448. if err != nil {
  1449. return 0, err
  1450. }
  1451. iNdEx = start + next
  1452. }
  1453. return iNdEx, nil
  1454. case 4:
  1455. return iNdEx, nil
  1456. case 5:
  1457. iNdEx += 4
  1458. return iNdEx, nil
  1459. default:
  1460. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1461. }
  1462. }
  1463. panic("unreachable")
  1464. }
  1465. var (
  1466. ErrInvalidLengthStructs = fmt.Errorf("proto: negative length found during unmarshaling")
  1467. ErrIntOverflowStructs = fmt.Errorf("proto: integer overflow")
  1468. )
  1469. func init() { proto.RegisterFile("structs.proto", fileDescriptorStructs) }
  1470. var fileDescriptorStructs = []byte{
  1471. // 630 bytes of a gzipped FileDescriptorProto
  1472. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xcf, 0x6a, 0xdb, 0x4c,
  1473. 0x10, 0xb7, 0x62, 0xc9, 0xb1, 0x47, 0x76, 0xbe, 0x64, 0x09, 0x41, 0x18, 0x3e, 0x5b, 0x18, 0x0a,
  1474. 0xa2, 0x50, 0xb9, 0x4d, 0xe8, 0xa5, 0xbd, 0xb9, 0x21, 0x10, 0x28, 0x6d, 0x59, 0x87, 0x9c, 0x0a,
  1475. 0xc6, 0x92, 0xd6, 0xce, 0x12, 0x79, 0xd7, 0xd1, 0xae, 0x52, 0x94, 0x27, 0xe9, 0x31, 0x4f, 0xd0,
  1476. 0xa7, 0xe8, 0x21, 0xc7, 0x9e, 0x7b, 0x08, 0xad, 0xfb, 0x22, 0x45, 0xbb, 0x92, 0xa2, 0xf4, 0xd4,
  1477. 0xde, 0xe6, 0x37, 0xff, 0x67, 0x7e, 0x33, 0xd0, 0x13, 0x32, 0x49, 0x43, 0x29, 0xfc, 0x75, 0xc2,
  1478. 0x25, 0x47, 0x5b, 0x51, 0xd0, 0x7f, 0xb6, 0xa4, 0xf2, 0x22, 0x0d, 0xfc, 0x90, 0xaf, 0xc6, 0x4b,
  1479. 0xbe, 0xe4, 0x63, 0x65, 0x0a, 0xd2, 0x85, 0x42, 0x0a, 0x28, 0x49, 0x87, 0xf4, 0x5f, 0xd6, 0xdc,
  1480. 0x45, 0xc6, 0x42, 0x79, 0x41, 0xd9, 0xb2, 0x26, 0xc5, 0x34, 0xd0, 0x19, 0x42, 0x1e, 0x8f, 0x03,
  1481. 0xb2, 0xd6, 0x61, 0xa3, 0x2b, 0xb0, 0x4f, 0x68, 0x4c, 0xce, 0x49, 0x22, 0x28, 0x67, 0xe8, 0x39,
  1482. 0x6c, 0x5f, 0x6b, 0xd1, 0x31, 0x5c, 0xc3, 0xb3, 0x0f, 0x77, 0xfd, 0x32, 0xc8, 0x3f, 0x27, 0xa1,
  1483. 0xe4, 0xc9, 0xc4, 0xbc, 0xbb, 0x1f, 0x36, 0x70, 0xe9, 0x86, 0x0e, 0xa0, 0x15, 0x91, 0x6b, 0x1a,
  1484. 0x12, 0x67, 0xcb, 0x35, 0xbc, 0x2e, 0x2e, 0x10, 0x72, 0x60, 0x9b, 0xb2, 0xeb, 0x79, 0x4c, 0x23,
  1485. 0xa7, 0xe9, 0x1a, 0x5e, 0x1b, 0x97, 0x70, 0x74, 0x02, 0x76, 0x51, 0xee, 0x2d, 0x15, 0x12, 0xbd,
  1486. 0x80, 0x76, 0x91, 0x4b, 0x38, 0x86, 0xdb, 0xf4, 0xec, 0xc3, 0xff, 0xfc, 0x28, 0xf0, 0x6b, 0x5d,
  1487. 0x15, 0x25, 0x2b, 0xb7, 0x57, 0xe6, 0xe7, 0xdb, 0x61, 0x63, 0xf4, 0xc5, 0x84, 0xbd, 0xdc, 0xeb,
  1488. 0x94, 0x2d, 0xf8, 0x59, 0x92, 0xb2, 0x70, 0x2e, 0x49, 0x84, 0x10, 0x98, 0x6c, 0xbe, 0x22, 0xaa,
  1489. 0xfd, 0x0e, 0x56, 0x32, 0x7a, 0x0a, 0xa6, 0xcc, 0xd6, 0xba, 0xc3, 0x9d, 0xc3, 0x83, 0x87, 0x91,
  1490. 0xaa, 0xf0, 0x6c, 0x4d, 0xb0, 0xf2, 0xc9, 0xe3, 0x05, 0xbd, 0x21, 0xaa, 0xe9, 0x26, 0x56, 0x32,
  1491. 0x72, 0xc1, 0x5e, 0x93, 0x64, 0x45, 0x85, 0xee, 0xd2, 0x74, 0x0d, 0xaf, 0x87, 0xeb, 0x2a, 0xf4,
  1492. 0x3f, 0xc0, 0x8a, 0x47, 0x74, 0x41, 0x49, 0x34, 0x13, 0x8e, 0xa5, 0x62, 0x3b, 0xa5, 0x66, 0x9a,
  1493. 0x2f, 0x23, 0x22, 0x31, 0x91, 0x24, 0x72, 0x5a, 0x7a, 0x19, 0x05, 0xac, 0xaf, 0x69, 0xfb, 0xd1,
  1494. 0x9a, 0xd0, 0x13, 0xd8, 0x61, 0x7c, 0x56, 0xaf, 0xdb, 0x56, 0x0e, 0x3d, 0xc6, 0x3f, 0xd4, 0x2a,
  1495. 0xd7, 0x18, 0xeb, 0xfc, 0x1d, 0x63, 0x7d, 0x68, 0x0b, 0x72, 0x95, 0x12, 0x16, 0x12, 0x07, 0x54,
  1496. 0xa7, 0x15, 0x46, 0x43, 0xb0, 0xab, 0x39, 0x98, 0x70, 0x6c, 0xd7, 0xf0, 0x2c, 0x5c, 0x8d, 0xf6,
  1497. 0x4e, 0xa0, 0x8f, 0x35, 0x87, 0x20, 0x73, 0xba, 0xae, 0xe1, 0x99, 0x93, 0xd7, 0x79, 0x81, 0xef,
  1498. 0xf7, 0xc3, 0xa3, 0x7f, 0xb8, 0x41, 0x7f, 0x7a, 0xc1, 0x13, 0x79, 0x7a, 0xfc, 0x90, 0x7d, 0x92,
  1499. 0xa1, 0x31, 0x40, 0x10, 0xf3, 0xf0, 0x72, 0xa6, 0x28, 0xe8, 0xe5, 0xd5, 0x27, 0xbb, 0x9b, 0xfb,
  1500. 0x61, 0x17, 0xcf, 0x3f, 0x4d, 0x72, 0xc3, 0x94, 0xde, 0x10, 0xdc, 0x09, 0x4a, 0x31, 0x5f, 0x92,
  1501. 0xc8, 0x56, 0x31, 0x65, 0x97, 0x33, 0x39, 0x4f, 0x96, 0x44, 0x3a, 0x7b, 0x8a, 0xf7, 0x5e, 0xa1,
  1502. 0x3d, 0x53, 0xca, 0xe2, 0x60, 0xbe, 0x1a, 0xd0, 0x7a, 0xc3, 0x53, 0x26, 0x05, 0xda, 0x07, 0x6b,
  1503. 0x41, 0x63, 0x22, 0xd4, 0x99, 0x58, 0x58, 0x83, 0x9c, 0xe7, 0x88, 0x26, 0x6a, 0x69, 0x94, 0x08,
  1504. 0x75, 0x2e, 0x16, 0xae, 0xab, 0xd4, 0xee, 0x74, 0x66, 0xa1, 0x2e, 0xc4, 0xc2, 0x15, 0xae, 0x93,
  1505. 0x6c, 0x2a, 0x53, 0x45, 0xf2, 0x3e, 0x58, 0x41, 0x26, 0x49, 0x79, 0x18, 0x1a, 0x3c, 0xe2, 0xa1,
  1506. 0xf5, 0x07, 0x0f, 0x7d, 0x68, 0xeb, 0x3f, 0x3a, 0x3d, 0x56, 0x13, 0x75, 0x71, 0x85, 0x47, 0xef,
  1507. 0xa1, 0xa3, 0xa7, 0x98, 0x12, 0x89, 0x3c, 0x68, 0x85, 0x0a, 0x14, 0xbf, 0x03, 0xf9, 0xef, 0x68,
  1508. 0x73, 0xc1, 0x7b, 0x61, 0xcf, 0xdb, 0x0b, 0x13, 0x92, 0xff, 0x88, 0x1a, 0xac, 0x89, 0x4b, 0x38,
  1509. 0xd9, 0xbf, 0xfb, 0x39, 0x68, 0xdc, 0x6d, 0x06, 0xc6, 0xb7, 0xcd, 0xc0, 0xf8, 0xb1, 0x19, 0x34,
  1510. 0x6e, 0x7f, 0x0d, 0x8c, 0xa0, 0xa5, 0x98, 0x3a, 0xfa, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x28, 0xfa,
  1511. 0x1e, 0x63, 0x9b, 0x04, 0x00, 0x00,
  1512. }