structs.proto 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. syntax = "proto3";
  2. package db;
  3. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  4. import "github.com/syncthing/syncthing/lib/protocol/bep.proto";
  5. option (gogoproto.goproto_getters_all) = false;
  6. option (gogoproto.sizer_all) = false;
  7. option (gogoproto.protosizer_all) = true;
  8. message FileVersion {
  9. protocol.Vector version = 1 [(gogoproto.nullable) = false];
  10. bytes device = 2;
  11. bool invalid = 3;
  12. }
  13. message VersionList {
  14. option (gogoproto.goproto_stringer) = false;
  15. repeated FileVersion versions = 1 [(gogoproto.nullable) = false];
  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. protocol.FileInfoType type = 2;
  22. int64 size = 3;
  23. uint32 permissions = 4;
  24. int64 modified_s = 5;
  25. int32 modified_ns = 11;
  26. uint64 modified_by = 12 [(gogoproto.customtype) = "github.com/syncthing/syncthing/lib/protocol.ShortID", (gogoproto.nullable) = false];
  27. bool deleted = 6;
  28. bool invalid = 7;
  29. bool no_permissions = 8;
  30. protocol.Vector version = 9 [(gogoproto.nullable) = false];
  31. int64 sequence = 10;
  32. string symlink_target = 17;
  33. }
  34. // For each folder and device we keep one of these to track the current
  35. // counts and sequence. We also keep one for the global state of the folder.
  36. message Counts {
  37. int32 files = 1;
  38. int32 directories = 2;
  39. int32 symlinks = 3;
  40. int32 deleted = 4;
  41. int64 bytes = 5;
  42. int64 sequence = 6; // zero for the global state
  43. bytes deviceID = 17; // device ID for remote devices, or special values for local/global
  44. }
  45. message CountsSet {
  46. repeated Counts counts = 1 [(gogoproto.nullable) = false];
  47. int64 created = 2; // unix nanos
  48. }