2016-07-04 03:40:29 -07:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package db;
|
|
|
|
|
2018-12-18 04:36:38 -07:00
|
|
|
import "repos/protobuf/gogoproto/gogo.proto";
|
|
|
|
import "lib/protocol/bep.proto";
|
2016-07-04 03:40:29 -07:00
|
|
|
|
|
|
|
option (gogoproto.goproto_getters_all) = false;
|
|
|
|
option (gogoproto.sizer_all) = false;
|
|
|
|
option (gogoproto.protosizer_all) = true;
|
2019-01-14 03:53:36 -07:00
|
|
|
option (gogoproto.goproto_unkeyed_all) = false;
|
|
|
|
option (gogoproto.goproto_unrecognized_all) = false;
|
|
|
|
option (gogoproto.goproto_sizecache_all) = false;
|
2016-07-04 03:40:29 -07:00
|
|
|
|
|
|
|
message FileVersion {
|
|
|
|
protocol.Vector version = 1 [(gogoproto.nullable) = false];
|
|
|
|
bytes device = 2;
|
2017-11-11 12:18:17 -07:00
|
|
|
bool invalid = 3;
|
2016-07-04 03:40:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
message VersionList {
|
|
|
|
option (gogoproto.goproto_stringer) = false;
|
|
|
|
repeated FileVersion versions = 1 [(gogoproto.nullable) = false];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Must be the same as FileInfo but without the blocks field
|
|
|
|
message FileInfoTruncated {
|
|
|
|
option (gogoproto.goproto_stringer) = false;
|
|
|
|
string name = 1;
|
|
|
|
protocol.FileInfoType type = 2;
|
|
|
|
int64 size = 3;
|
|
|
|
uint32 permissions = 4;
|
2016-08-06 06:05:59 -07:00
|
|
|
int64 modified_s = 5;
|
|
|
|
int32 modified_ns = 11;
|
2017-01-02 17:16:21 -07:00
|
|
|
uint64 modified_by = 12 [(gogoproto.customtype) = "github.com/syncthing/syncthing/lib/protocol.ShortID", (gogoproto.nullable) = false];
|
2016-07-04 03:40:29 -07:00
|
|
|
bool deleted = 6;
|
2018-06-24 00:50:18 -07:00
|
|
|
bool invalid = 7 [(gogoproto.customname) = "RawInvalid"];
|
2016-07-04 03:40:29 -07:00
|
|
|
bool no_permissions = 8;
|
|
|
|
protocol.Vector version = 9 [(gogoproto.nullable) = false];
|
2016-07-29 12:54:24 -07:00
|
|
|
int64 sequence = 10;
|
2018-04-16 11:08:50 -07:00
|
|
|
int32 block_size = 13 [(gogoproto.customname) = "RawBlockSize"];
|
|
|
|
// repeated BlockInfo Blocks = 16
|
2016-12-09 11:02:18 -07:00
|
|
|
string symlink_target = 17;
|
2018-06-24 00:50:18 -07:00
|
|
|
|
|
|
|
// see bep.proto
|
|
|
|
uint32 local_flags = 1000;
|
2016-07-04 03:40:29 -07:00
|
|
|
}
|
2017-12-14 02:51:17 -07:00
|
|
|
|
|
|
|
// For each folder and device we keep one of these to track the current
|
|
|
|
// counts and sequence. We also keep one for the global state of the folder.
|
|
|
|
message Counts {
|
2018-07-12 01:15:57 -07:00
|
|
|
int32 files = 1;
|
|
|
|
int32 directories = 2;
|
|
|
|
int32 symlinks = 3;
|
|
|
|
int32 deleted = 4;
|
|
|
|
int64 bytes = 5;
|
|
|
|
int64 sequence = 6; // zero for the global state
|
|
|
|
bytes deviceID = 17; // device ID for remote devices, or special values for local/global
|
|
|
|
uint32 localFlags = 18; // the local flag for this count bucket
|
2017-12-14 02:51:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
message CountsSet {
|
|
|
|
repeated Counts counts = 1 [(gogoproto.nullable) = false];
|
|
|
|
int64 created = 2; // unix nanos
|
|
|
|
}
|