structs.proto 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. protocol.PlatformData platform = 14;
  35. // see bep.proto
  36. uint32 local_flags = 1000;
  37. bytes version_hash = 1001;
  38. int64 inode_change_ns = 1002;
  39. bool deleted = 6;
  40. bool invalid = 7 [(ext.goname) = "RawInvalid"];
  41. bool no_permissions = 8;
  42. }
  43. // BlockList is the structure used to store block lists
  44. message BlockList {
  45. repeated protocol.BlockInfo blocks = 1;
  46. }
  47. // IndirectionHashesOnly is used to only unmarshal the indirection hashes
  48. // from a FileInfo
  49. message IndirectionHashesOnly {
  50. bytes blocks_hash = 18;
  51. bytes version_hash = 1001;
  52. }
  53. // For each folder and device we keep one of these to track the current
  54. // counts and sequence. We also keep one for the global state of the folder.
  55. message Counts {
  56. option (gogoproto.goproto_stringer) = false;
  57. int32 files = 1;
  58. int32 directories = 2;
  59. int32 symlinks = 3;
  60. int32 deleted = 4;
  61. int64 bytes = 5;
  62. int64 sequence = 6; // zero for the global state
  63. bytes device_id = 17 [(ext.goname) = "DeviceID"]; // device ID for remote devices, or special values for local/global
  64. uint32 local_flags = 18; // the local flag for this count bucket
  65. }
  66. message CountsSet {
  67. repeated Counts counts = 1;
  68. int64 created = 2; // unix nanos
  69. }
  70. message FileVersionDeprecated {
  71. protocol.Vector version = 1;
  72. bytes device = 2;
  73. bool invalid = 3;
  74. bool deleted = 4;
  75. }
  76. message VersionListDeprecated {
  77. option (gogoproto.goproto_stringer) = false;
  78. repeated FileVersionDeprecated versions = 1;
  79. }
  80. message ObservedFolder {
  81. google.protobuf.Timestamp time = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
  82. string label = 2;
  83. bool receive_encrypted = 3;
  84. bool remote_encrypted = 4;
  85. }
  86. message ObservedDevice {
  87. google.protobuf.Timestamp time = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
  88. string name = 2;
  89. string address = 3;
  90. }