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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
// This file is @generated by prost-build.
/// \[\#next-free-field: 6\]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Gzip {
/// Value from 1 to 9 that controls the amount of internal memory used by zlib. Higher values
/// use more memory, but are faster and produce better compression results.
///
/// Defaults to `5`.
#[prost(message, optional, tag = "1")]
pub memory_level: ::core::option::Option<
super::super::super::super::super::super::google::protobuf::UInt32Value,
>,
/// A value used for selecting the zlib compression level. This setting will affect speed and
/// amount of compression applied to the content. `BEST_COMPRESSION` provides higher compression
/// at the cost of higher latency and is equal to `COMPRESSION_LEVEL_9`. `BEST_SPEED` provides
/// lower compression with minimum impact on response time, the same as `COMPRESSION_LEVEL_1`.
/// `DEFAULT_COMPRESSION` provides an optimal result between speed and compression. According
/// to zlib's manual, this level gives the same result as `COMPRESSION_LEVEL_6`.
///
/// Defaults to `DEFAULT_COMPRESSION`.
#[prost(enumeration = "gzip::CompressionLevel", tag = "2")]
pub compression_level: i32,
/// A value used for selecting the zlib compression strategy which is directly related to the
/// characteristics of the content. Most of the time `DEFAULT_STRATEGY` will be the best choice,
/// though there are situations when changing this parameter might produce better results. For
/// example, run-length encoding (RLE) is typically used when the content is known for having
/// sequences in which the same data occurs many consecutive times. For more information about
/// each strategy, please refer to the `zlib manual <<https://www.zlib.net/manual.html>`\_.>
///
/// Defaults to `DEFAULT_STRATEGY`.
#[prost(enumeration = "gzip::CompressionStrategy", tag = "3")]
pub compression_strategy: i32,
/// Value from 9 to 15 that represents the base two logarithmic of the compressor's window size.
/// Larger window results in better compression at the expense of memory usage. For more details
/// about this parameter, please refer to the
/// `zlib manual <<https://www.zlib.net/manual.html>`\_> for `deflateInit2`.
///
/// Defaults to `12`, which will produce a 4096 bytes window.
#[prost(message, optional, tag = "4")]
pub window_bits: ::core::option::Option<
super::super::super::super::super::super::google::protobuf::UInt32Value,
>,
/// Value for zlib's next output buffer. See the
/// `zlib manual <<https://www.zlib.net/manual.html>`\_> for more details. Also see
/// `envoy#8448 <<https://github.com/envoyproxy/envoy/issues/8448>`\_> for context on this filter's
/// performance.
///
/// Defaults to `4096`.
#[prost(message, optional, tag = "5")]
pub chunk_size: ::core::option::Option<
super::super::super::super::super::super::google::protobuf::UInt32Value,
>,
}
/// Nested message and enum types in `Gzip`.
pub mod gzip {
/// All the values of this enumeration translate directly to zlib's compression strategies.
/// For more information about each strategy, please refer to the
/// `zlib manual <<https://www.zlib.net/manual.html>`\_.>
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CompressionStrategy {
/// Default compression strategy.
DefaultStrategy = 0,
/// Filtered compression strategy, designed for data produced by a filter or predictor.
Filtered = 1,
/// Huffman-only compression strategy, which uses Huffman encoding only.
HuffmanOnly = 2,
/// Run-length encoding (RLE) compression strategy, designed for image data.
Rle = 3,
/// Fixed compression strategy, which prevents the use of dynamic Huffman codes.
Fixed = 4,
}
impl CompressionStrategy {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::DefaultStrategy => "DEFAULT_STRATEGY",
Self::Filtered => "FILTERED",
Self::HuffmanOnly => "HUFFMAN_ONLY",
Self::Rle => "RLE",
Self::Fixed => "FIXED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEFAULT_STRATEGY" => Some(Self::DefaultStrategy),
"FILTERED" => Some(Self::Filtered),
"HUFFMAN_ONLY" => Some(Self::HuffmanOnly),
"RLE" => Some(Self::Rle),
"FIXED" => Some(Self::Fixed),
_ => None,
}
}
}
/// Compression level values for zlib. Higher levels provide better compression at the cost of
/// increased latency and CPU usage.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CompressionLevel {
/// Default compression level, equivalent to `COMPRESSION_LEVEL_6`.
DefaultCompression = 0,
/// Fastest compression with minimal compression ratio, equivalent to `COMPRESSION_LEVEL_1`.
BestSpeed = 1,
/// Compression level 2.
CompressionLevel2 = 2,
/// Compression level 3.
CompressionLevel3 = 3,
/// Compression level 4.
CompressionLevel4 = 4,
/// Compression level 5.
CompressionLevel5 = 5,
/// Compression level 6.
CompressionLevel6 = 6,
/// Compression level 7.
CompressionLevel7 = 7,
/// Compression level 8.
CompressionLevel8 = 8,
/// Compression level 9 (best compression).
CompressionLevel9 = 9,
}
impl CompressionLevel {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::DefaultCompression => "DEFAULT_COMPRESSION",
Self::BestSpeed => "BEST_SPEED",
Self::CompressionLevel2 => "COMPRESSION_LEVEL_2",
Self::CompressionLevel3 => "COMPRESSION_LEVEL_3",
Self::CompressionLevel4 => "COMPRESSION_LEVEL_4",
Self::CompressionLevel5 => "COMPRESSION_LEVEL_5",
Self::CompressionLevel6 => "COMPRESSION_LEVEL_6",
Self::CompressionLevel7 => "COMPRESSION_LEVEL_7",
Self::CompressionLevel8 => "COMPRESSION_LEVEL_8",
Self::CompressionLevel9 => "COMPRESSION_LEVEL_9",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DEFAULT_COMPRESSION" => Some(Self::DefaultCompression),
"BEST_SPEED" => Some(Self::BestSpeed),
"COMPRESSION_LEVEL_2" => Some(Self::CompressionLevel2),
"COMPRESSION_LEVEL_3" => Some(Self::CompressionLevel3),
"COMPRESSION_LEVEL_4" => Some(Self::CompressionLevel4),
"COMPRESSION_LEVEL_5" => Some(Self::CompressionLevel5),
"COMPRESSION_LEVEL_6" => Some(Self::CompressionLevel6),
"COMPRESSION_LEVEL_7" => Some(Self::CompressionLevel7),
"COMPRESSION_LEVEL_8" => Some(Self::CompressionLevel8),
"COMPRESSION_LEVEL_9" => Some(Self::CompressionLevel9),
_ => None,
}
}
}
}
impl ::prost::Name for Gzip {
const NAME: &'static str = "Gzip";
const PACKAGE: &'static str = "envoy.extensions.compression.gzip.compressor.v3";
fn full_name() -> ::prost::alloc::string::String {
"envoy.extensions.compression.gzip.compressor.v3.Gzip".into()
}
fn type_url() -> ::prost::alloc::string::String {
"type.googleapis.com/envoy.extensions.compression.gzip.compressor.v3.Gzip".into()
}
}