-
Notifications
You must be signed in to change notification settings - Fork 0
/
cdr.proto
85 lines (68 loc) · 1.35 KB
/
cdr.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
syntax = "proto3";
package pachyderm.cdr;
option go_package = "github.com/pachyderm/cdr";
message Ref {
oneof body {
// Sources
HTTP http = 1;
// Constraints
ContentHash content_hash = 32;
SizeLimits size_limits = 33;
// 1:1 Transforms
Cipher cipher = 64;
Compress compress = 65;
Slice slice = 66;
// Many:1 Transforms
Concat concat = 96;
}
}
message HTTP {
string url = 1;
map<string, string> headers = 2;
}
// Contraints
message ContentHash {
Ref inner = 1;
HashAlgo algo = 2;
bytes hash = 3;
}
// Uses numeric values from this table
// https://github.com/multiformats/multicodec/blob/master/table.csv
enum HashAlgo {
UNKNOWN_HASH = 0;
BLAKE2b_256 = 45600;
}
message SizeLimits {
Ref inner = 1;
int64 min = 2;
int64 max = 3;
}
// 1:1 Transforms
message Cipher {
Ref inner = 1;
CipherAlgo algo = 2;
bytes key = 3;
bytes nonce = 4;
}
enum CipherAlgo {
UNKNOWN_CIPHER = 0;
CHACHA20 = 1;
}
message Compress {
Ref inner = 1;
CompressAlgo algo = 2;
}
enum CompressAlgo{
UNKNOWN_COMPRESS = 0;
GZIP = 1;
}
// 1:1 Transforms
message Slice {
Ref inner = 1;
uint64 start = 2;
uint64 end = 3;
}
// Many:1 Transforms
message Concat {
repeated Ref refs = 1;
}