structs.proto 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. syntax = "proto3";
  2. package db;
  3. import "repos/protobuf/gogoproto/gogo.proto";
  4. import "lib/protocol/bep.proto";
  5. option (gogoproto.goproto_getters_all) = false;
  6. option (gogoproto.sizer_all) = false;
  7. option (gogoproto.protosizer_all) = true;
  8. option (gogoproto.goproto_unkeyed_all) = false;
  9. option (gogoproto.goproto_unrecognized_all) = false;
  10. option (gogoproto.goproto_sizecache_all) = false;
  11. message FileVersion {
  12. protocol.Vector version = 1 [(gogoproto.nullable) = false];
  13. bytes device = 2;
  14. bool invalid = 3;
  15. bool deleted = 4;
  16. }
  17. message VersionList {
  18. option (gogoproto.goproto_stringer) = false;
  19. repeated FileVersion versions = 1 [(gogoproto.nullable) = false];
  20. }
  21. // Must be the same as FileInfo but without the blocks field
  22. message FileInfoTruncated {
  23. option (gogoproto.goproto_stringer) = false;
  24. string name = 1;
  25. int64 size = 3;
  26. int64 modified_s = 5;
  27. uint64 modified_by = 12 [(gogoproto.customtype) = "github.com/syncthing/syncthing/lib/protocol.ShortID", (gogoproto.nullable) = false];
  28. protocol.Vector version = 9 [(gogoproto.nullable) = false];
  29. int64 sequence = 10;
  30. // repeated BlockInfo Blocks = 16
  31. string symlink_target = 17;
  32. bytes blocks_hash = 18;
  33. protocol.FileInfoType type = 2;
  34. uint32 permissions = 4;
  35. int32 modified_ns = 11;
  36. int32 block_size = 13 [(gogoproto.customname) = "RawBlockSize"];
  37. // see bep.proto
  38. uint32 local_flags = 1000;
  39. bytes version_hash = 1001;
  40. bool deleted = 6;
  41. bool invalid = 7 [(gogoproto.customname) = "RawInvalid"];
  42. bool no_permissions = 8;
  43. }
  44. // BlockList is the structure used to store block lists
  45. message BlockList {
  46. repeated protocol.BlockInfo Blocks = 1 [(gogoproto.nullable) = false];
  47. }
  48. // IndirectionHashesOnly is used to only unmarshal the indirection hashes
  49. // from a FileInfo
  50. message IndirectionHashesOnly {
  51. bytes blocks_hash = 18;
  52. bytes version_hash = 1001;
  53. }
  54. // For each folder and device we keep one of these to track the current
  55. // counts and sequence. We also keep one for the global state of the folder.
  56. message Counts {
  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 deviceID = 17; // device ID for remote devices, or special values for local/global
  64. uint32 localFlags = 18; // the local flag for this count bucket
  65. }
  66. message CountsSet {
  67. repeated Counts counts = 1 [(gogoproto.nullable) = false];
  68. int64 created = 2; // unix nanos
  69. }