tvl-depot/tvix/proto/castore.proto
Florian Klink 5731fbbee3 chore(tvix/proto): change package name to tvix.proto.v1
`buf` doesn't like protos with different package names in the same
directory.

Change-Id: I30806b46b88f103779faa40466461091a4a01e06
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7130
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: Adam Joseph <adam@westernsemico.com>
Tested-by: BuildkiteCI
2022-11-08 17:57:53 +00:00

55 lines
1.9 KiB
Protocol Buffer

// SPDX-FileCopyrightText: edef <edef@unfathomable.blue>
// SPDX-License-Identifier: OSL-3.0 OR MIT OR Apache-2.0
syntax = "proto3";
package tvix.proto.v1;
// A Directory can contain Directory, File or Symlink 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.
message Directory {
repeated DirectoryNode directories = 1;
repeated FileNode files = 2;
repeated SymlinkNode symlinks = 3;
}
// A DirectoryNode represents a directory in a Directory.
message DirectoryNode {
// The (base)name of the directory
string name = 1;
// The blake3 hash of a Directory message, serialized in protobuf canonical form.
bytes ref = 2;
// Number of child elements in the Directory referred to by ref.
// Calculated by summing up the numbers of `directories`, `files` and `symlinks`,
// 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?
uint32 size = 3;
}
// A FileNode represents a regular or executable file in a Directory.
message FileNode {
// The (base)name of the file
string name = 1;
// The blake3 hash of the file contents
bytes ref = 2;
// The file content size
uint32 size = 3;
// Whether the file is executable
bool executable = 4;
}
// A SymlinkNode represents a symbolic link in a Directory.
message SymlinkNode {
// The (base)name of the symlink
string name = 1;
// The target of the symlink.
string target = 2;
}