Files
git-pages/src/schema.proto
Catherine 91dc7e0c54 Add original (decompressed) size to site manifest.
This size is not used by git-pages itself, and is not representative of
storage needs, but may be used for estimating how large a site would
be if downloaded in its entirety.
2025-11-16 19:27:04 +00:00

89 lines
2.3 KiB
Protocol Buffer

edition = "2023";
option go_package = "codeberg.org/git-pages/git-pages/git_pages";
enum Type {
// Invalid entry.
Invalid = 0;
// Directory.
Directory = 1;
// Inline file. `Blob.Data` contains file contents.
InlineFile = 2;
// External file. `Blob.Data` contains object reference.
ExternalFile = 3;
// Symlink. `Blob.Data` contains relative path.
Symlink = 4;
}
enum Transform {
// No transformation.
None = 0;
// Zstandard compression.
Zstandard = 1;
}
message Entry {
Type type = 1;
// Only present for `type == InlineFile` and `type == ExternalFile`.
// For transformed entries, refers to the post-transformation (compressed) size.
int64 size = 2;
// Meaning depends on `type`:
// * If `type == InlineFile`, contains file data.
// * If `type == ExternalFile`, contains blob name (an otherwise unspecified
// cryptographically secure content hash).
// * If `type == Symlink`, contains link target.
// * Otherwise not present.
bytes data = 3;
// Only present for `type == InlineFile` and `type == ExternalFile` that
// have been transformed.
Transform transform = 4;
// Only present for `type == InlineFile` and `type == ExternalFile`.
// Currently, optional (not present on certain legacy manifests).
string content_type = 5;
}
// See https://docs.netlify.com/manage/routing/redirects/overview/ for details.
// Only a subset of the Netlify specification is representable here.
message RedirectRule {
string from = 1;
string to = 2;
uint32 status = 3;
bool force = 4;
}
// See https://docs.netlify.com/manage/routing/headers/ for details.
message Header {
string name = 1;
repeated string values = 2;
}
message HeaderRule {
string path = 1;
repeated Header header_map = 2;
}
message Problem {
string path = 1;
string cause = 2;
}
message Manifest {
// Source metadata
string repo_url = 1;
string branch = 2;
string commit = 3;
// Contents
map<string, Entry> contents = 4;
int64 original_size = 10; // total size of entries before compression
int64 compressed_size = 5; // simple sum of each `entry.size`
int64 stored_size = 8; // total size of (deduplicated) external objects
// Netlify-style `_redirects` and `_headers`
repeated RedirectRule redirects = 6;
repeated HeaderRule headers = 9;
// Diagnostics for non-fatal errors
repeated Problem problems = 7;
}