GRPC Core  18.0.0
compression_types.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2016 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
20 #define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
21 
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
30 #define GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY \
31  "grpc-internal-encoding-request"
32 
39 #define GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM \
40  "grpc.default_compression_algorithm"
43 #define GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL "grpc.default_compression_level"
51 #define GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET \
52  "grpc.compression_enabled_algorithms_bitset"
57 typedef enum {
61  /* EXPERIMENTAL: Stream compression is currently experimental. */
63  /* TODO(ctiller): snappy */
66 
71 typedef enum {
78 
79 typedef struct grpc_compression_options {
84 
91  int is_set;
94 
99  int is_set;
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #endif /* GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H */
grpc_compression_level
Compression levels allow a party with knowledge of its peer's accepted encodings to request compressi...
Definition: compression_types.h:71
@ GRPC_COMPRESS_LEVEL_MED
Definition: compression_types.h:74
@ GRPC_COMPRESS_LEVEL_HIGH
Definition: compression_types.h:75
@ GRPC_COMPRESS_LEVEL_COUNT
Definition: compression_types.h:76
@ GRPC_COMPRESS_LEVEL_NONE
Definition: compression_types.h:72
@ GRPC_COMPRESS_LEVEL_LOW
Definition: compression_types.h:73
struct grpc_compression_options grpc_compression_options
grpc_compression_algorithm
The various compression algorithms supported by gRPC (not sorted by compression level)
Definition: compression_types.h:57
@ GRPC_COMPRESS_NONE
Definition: compression_types.h:58
@ GRPC_COMPRESS_STREAM_GZIP
Definition: compression_types.h:62
@ GRPC_COMPRESS_DEFLATE
Definition: compression_types.h:59
@ GRPC_COMPRESS_GZIP
Definition: compression_types.h:60
@ GRPC_COMPRESS_ALGORITHMS_COUNT
Definition: compression_types.h:64
The default message compression algorithm.
Definition: compression_types.h:98
grpc_compression_algorithm algorithm
Definition: compression_types.h:100
The default compression level.
Definition: compression_types.h:90
grpc_compression_level level
Definition: compression_types.h:92
Definition: compression_types.h:79
uint32_t enabled_algorithms_bitset
All algs are enabled by default.
Definition: compression_types.h:83
struct grpc_compression_options::grpc_compression_options_default_algorithm default_algorithm
struct grpc_compression_options::grpc_compression_options_default_level default_level