forked from
whitequark.org/git-pages
fork of whitequark.org/git-pages with mods for tangled
1edition = "2023";
2
3option go_package = "codeberg.org/git-pages/git-pages/git_pages";
4
5enum Type {
6 // Invalid entry.
7 Invalid = 0;
8 // Directory.
9 Directory = 1;
10 // Inline file. `Blob.Data` contains file contents.
11 InlineFile = 2;
12 // External file. `Blob.Data` contains object reference.
13 ExternalFile = 3;
14 // Symlink. `Blob.Data` contains relative path.
15 Symlink = 4;
16}
17
18// Transformation names should match HTTP `Accept-Encoding:` header.
19enum Transform {
20 // No transformation.
21 Identity = 0;
22 // Zstandard compression.
23 Zstd = 1;
24}
25
26message Entry {
27 Type type = 1;
28 // Only present for `type == InlineFile` and `type == ExternalFile`.
29 // For transformed entries, refers to the pre-transformation (decompressed) size; otherwise
30 // equal to `compressed_size`.
31 int64 original_size = 7;
32 // Only present for `type == InlineFile` and `type == ExternalFile`.
33 // For transformed entries, refers to the post-transformation (compressed) size; otherwise
34 // equal to `original_size`.
35 int64 compressed_size = 2;
36 // Meaning depends on `type`:
37 // * If `type == InlineFile`, contains file data.
38 // * If `type == ExternalFile`, contains blob name (an otherwise unspecified
39 // cryptographically secure content hash).
40 // * If `type == Symlink`, contains link target.
41 // * Otherwise not present.
42 bytes data = 3;
43 // Only present for `type == InlineFile` and `type == ExternalFile` that
44 // have been transformed.
45 Transform transform = 4;
46 // Only present for `type == InlineFile` and `type == ExternalFile`.
47 // Currently, optional (not present on certain legacy manifests).
48 string content_type = 5;
49 // May be present for `type == InlineFile` and `type == ExternalFile`.
50 // Used to reduce the amount of work being done during git checkouts.
51 // The type of hash used is determined by the length:
52 // * 40 bytes: SHA1DC (as hex)
53 // * 64 bytes: SHA256 (as hex)
54 string git_hash = 6;
55}
56
57// See https://docs.netlify.com/manage/routing/redirects/overview/ for details.
58// Only a subset of the Netlify specification is representable here.
59message RedirectRule {
60 string from = 1;
61 string to = 2;
62 uint32 status = 3;
63 bool force = 4;
64}
65
66// See https://docs.netlify.com/manage/routing/headers/ for details.
67message Header {
68 string name = 1;
69 repeated string values = 2;
70}
71
72message HeaderRule {
73 string path = 1;
74 repeated Header header_map = 2;
75}
76
77message Problem {
78 string path = 1;
79 string cause = 2;
80}
81
82message Manifest {
83 // Source metadata
84 string repo_url = 1;
85 string branch = 2;
86 string commit = 3;
87
88 // Contents
89 map<string, Entry> contents = 4;
90 int64 original_size = 10; // sum of each `entry.original_size`
91 int64 compressed_size = 5; // sum of each `entry.compressed_size`
92 int64 stored_size = 8; // sum of deduplicated `entry.compressed_size` for external files only
93
94 // Netlify-style `_redirects` and `_headers`
95 repeated RedirectRule redirects = 6;
96 repeated HeaderRule headers = 9;
97
98 // Diagnostics for non-fatal errors
99 repeated Problem problems = 7;
100}