2022-10-28 16:26:13 +02:00
|
|
|
// SPDX-FileCopyrightText: edef <edef@unfathomable.blue>
|
|
|
|
// SPDX-License-Identifier: OSL-3.0 OR MIT OR Apache-2.0
|
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package fossil.store;
|
|
|
|
|
2022-10-28 16:26:21 +02:00
|
|
|
// A Directory can contain Directory, File or Link nodes.
|
|
|
|
// Each of these nodes have a name attribute, which is the basename in that directory
|
|
|
|
// and node type specific attributes.
|
|
|
|
// The name attribute:
|
|
|
|
// - may not contain slashes or null bytes
|
|
|
|
// - needs to be unique across all three lists
|
|
|
|
// Elements in each list need to be lexicographically ordered by the name
|
|
|
|
// attribute.
|
2022-10-28 16:26:13 +02:00
|
|
|
message Directory {
|
|
|
|
repeated DirectoryNode directories = 1;
|
|
|
|
repeated FileNode files = 2;
|
|
|
|
repeated LinkNode links = 3;
|
|
|
|
}
|
|
|
|
|
2022-10-28 16:26:21 +02:00
|
|
|
// A DirectoryNode represents a directory in a Directory.
|
2022-10-28 16:26:13 +02:00
|
|
|
message DirectoryNode {
|
2022-10-28 16:26:21 +02:00
|
|
|
// The (base)name of the directory
|
2022-10-28 16:26:13 +02:00
|
|
|
string name = 1;
|
2022-10-28 16:26:21 +02:00
|
|
|
// The blake3 hash of a Directory message, serialized in protobuf canonical form.
|
2022-10-28 16:26:13 +02:00
|
|
|
bytes ref = 2;
|
2022-10-28 16:26:21 +02:00
|
|
|
// Number of child elements in the Directory referred to by ref.
|
|
|
|
// Calculated by summing up the numbers of `directories`, `files` and `links`,
|
|
|
|
// and for each directory, its size field. Used for inode number calculation
|
|
|
|
// TODO(flokli): These numbers can't really be verified until you know the whole graph.
|
|
|
|
// Is this a problem? Should we instead only have this field
|
|
|
|
// in our local representation?
|
2022-10-28 16:26:13 +02:00
|
|
|
uint32 size = 3;
|
|
|
|
}
|
|
|
|
|
2022-10-28 16:26:21 +02:00
|
|
|
// A FileNode represents a regular or executable file in a Directory.
|
2022-10-28 16:26:13 +02:00
|
|
|
message FileNode {
|
2022-10-28 16:26:21 +02:00
|
|
|
// The (base)name of the file
|
2022-10-28 16:26:13 +02:00
|
|
|
string name = 1;
|
2022-10-28 16:26:21 +02:00
|
|
|
// The blake3 hash of the file contents
|
2022-10-28 16:26:13 +02:00
|
|
|
bytes ref = 2;
|
2022-10-28 16:26:21 +02:00
|
|
|
// The file content size
|
2022-10-28 16:26:13 +02:00
|
|
|
uint32 size = 3;
|
2022-10-28 16:26:21 +02:00
|
|
|
// Whether the file is executable
|
2022-10-28 16:26:13 +02:00
|
|
|
bool executable = 4;
|
|
|
|
}
|
|
|
|
|
2022-10-28 16:26:21 +02:00
|
|
|
// A LinkNode represents a symbolic link in a Directory.
|
2022-10-28 16:26:13 +02:00
|
|
|
message LinkNode {
|
2022-10-28 16:26:21 +02:00
|
|
|
// The (base)name of the symlink
|
2022-10-28 16:26:13 +02:00
|
|
|
string name = 1;
|
2022-10-28 16:26:21 +02:00
|
|
|
// The target of the symlink.
|
2022-10-28 16:26:13 +02:00
|
|
|
string target = 2;
|
|
|
|
}
|