initial import

This commit is contained in:
2023-10-16 21:57:57 -07:00
commit d9f779f071
7 changed files with 227 additions and 0 deletions

11
proto/header.proto Normal file
View File

@@ -0,0 +1,11 @@
syntax = 'proto3';
package sgardpb;
import "google/protobuf/timestamp.proto";
// Header defines common metadata for messages in sgard.
message Header {
uint32 version = 1;
google.protobuf.Timestamp created = 2;
google.protobuf.Timestamp updated = 3;
}

11
proto/homedir.proto Normal file
View File

@@ -0,0 +1,11 @@
syntax = 'proto3';
package sgardpb;
import 'header.proto';
import 'path.proto';
message HomeDir {
Header header = 1;
map<string, Source> files = 5;
};

31
proto/path.proto Normal file
View File

@@ -0,0 +1,31 @@
syntax = 'proto3';
package sgardpb;
import 'header.proto';
import "google/protobuf/timestamp.proto";
enum PathType {
PATHTYPE_UNSPECIFIED = 0;
PATHTYPE_FILE = 1;
PATHTYPE_DIRECTORY = 2;
PATHTYPE_LINK = 3;
};
message FilePath {
Header header = 1;
string source_path = 2;
string dest_path = 3;
// todo: add mode, action (e.g. copy vs link)
};
message Source {
Header header = 1;
PathType path_type = 2;
oneof path {
FilePath file = 5;
};
};