structs.proto 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. syntax = "proto3";
  2. package db;
  3. import "repos/protobuf/gogoproto/gogo.proto";
  4. import "google/protobuf/timestamp.proto";
  5. import "lib/protocol/bep.proto";
  6. import "ext.proto";
  7. message FileVersion {
  8. protocol.Vector version = 1;
  9. bool deleted = 2;
  10. repeated bytes devices = 3;
  11. repeated bytes invalid_devices = 4;
  12. }
  13. message VersionList {
  14. option (gogoproto.goproto_stringer) = false;
  15. repeated FileVersion versions = 1 [(ext.goname) = "RawVersions"];
  16. }
  17. // Must be the same as FileInfo but without the blocks field
  18. message FileInfoTruncated {
  19. option (gogoproto.goproto_stringer) = false;
  20. string name = 1;
  21. int64 size = 3;
  22. int64 modified_s = 5;
  23. uint64 modified_by = 12 [(ext.gotype) = "github.com/syncthing/syncthing/lib/protocol.ShortID"];
  24. protocol.Vector version = 9;
  25. int64 sequence = 10;
  26. // repeated BlockInfo Blocks = 16
  27. string symlink_target = 17;
  28. bytes blocks_hash = 18;
  29. bytes encrypted = 19;
  30. protocol.FileInfoType type = 2;
  31. uint32 permissions = 4;
  32. int32 modified_ns = 11;
  33. int32 block_size = 13 [(ext.goname) = "RawBlockSize"];
  34. // see bep.proto
  35. uint32 local_flags = 1000;
  36. bytes version_hash = 1001;
  37. bool deleted = 6;
  38. bool invalid = 7 [(ext.goname) = "RawInvalid"];
  39. bool no_permissions = 8;
  40. }
  41. // BlockList is the structure used to store block lists
  42. message BlockList {
  43. repeated protocol.BlockInfo blocks = 1;
  44. }
  45. // IndirectionHashesOnly is used to only unmarshal the indirection hashes
  46. // from a FileInfo
  47. message IndirectionHashesOnly {
  48. bytes blocks_hash = 18;
  49. bytes version_hash = 1001;
  50. }
  51. // For each folder and device we keep one of these to track the current
  52. // counts and sequence. We also keep one for the global state of the folder.
  53. message Counts {
  54. option (gogoproto.goproto_stringer) = false;
  55. int32 files = 1;
  56. int32 directories = 2;
  57. int32 symlinks = 3;
  58. int32 deleted = 4;
  59. int64 bytes = 5;
  60. int64 sequence = 6; // zero for the global state
  61. bytes device_id = 17 [(ext.goname) = "DeviceID"]; // device ID for remote devices, or special values for local/global
  62. uint32 local_flags = 18; // the local flag for this count bucket
  63. }
  64. message CountsSet {
  65. repeated Counts counts = 1;
  66. int64 created = 2; // unix nanos
  67. }
  68. message FileVersionDeprecated {
  69. protocol.Vector version = 1;
  70. bytes device = 2;
  71. bool invalid = 3;
  72. bool deleted = 4;
  73. }
  74. message VersionListDeprecated {
  75. option (gogoproto.goproto_stringer) = false;
  76. repeated FileVersionDeprecated versions = 1;
  77. }
  78. message ObservedFolder {
  79. google.protobuf.Timestamp time = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
  80. string label = 2;
  81. bool receive_encrypted = 3;
  82. }
  83. message ObservedDevice {
  84. google.protobuf.Timestamp time = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
  85. string name = 2;
  86. string address = 3;
  87. }