structs.proto 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. }
  16. message VersionList {
  17. option (gogoproto.goproto_stringer) = false;
  18. repeated FileVersion versions = 1 [(gogoproto.nullable) = false];
  19. }
  20. // Must be the same as FileInfo but without the blocks field
  21. message FileInfoTruncated {
  22. option (gogoproto.goproto_stringer) = false;
  23. string name = 1;
  24. protocol.FileInfoType type = 2;
  25. int64 size = 3;
  26. uint32 permissions = 4;
  27. int64 modified_s = 5;
  28. int32 modified_ns = 11;
  29. uint64 modified_by = 12 [(gogoproto.customtype) = "github.com/syncthing/syncthing/lib/protocol.ShortID", (gogoproto.nullable) = false];
  30. bool deleted = 6;
  31. bool invalid = 7 [(gogoproto.customname) = "RawInvalid"];
  32. bool no_permissions = 8;
  33. protocol.Vector version = 9 [(gogoproto.nullable) = false];
  34. int64 sequence = 10;
  35. int32 block_size = 13 [(gogoproto.customname) = "RawBlockSize"];
  36. // repeated BlockInfo Blocks = 16
  37. string symlink_target = 17;
  38. // see bep.proto
  39. uint32 local_flags = 1000;
  40. }
  41. // For each folder and device we keep one of these to track the current
  42. // counts and sequence. We also keep one for the global state of the folder.
  43. message Counts {
  44. int32 files = 1;
  45. int32 directories = 2;
  46. int32 symlinks = 3;
  47. int32 deleted = 4;
  48. int64 bytes = 5;
  49. int64 sequence = 6; // zero for the global state
  50. bytes deviceID = 17; // device ID for remote devices, or special values for local/global
  51. uint32 localFlags = 18; // the local flag for this count bucket
  52. }
  53. message CountsSet {
  54. repeated Counts counts = 1 [(gogoproto.nullable) = false];
  55. int64 created = 2; // unix nanos
  56. }