GRPC Objective-C  1.26.0
GRPCTypes.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2019 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 
24 typedef NS_ENUM(NSUInteger, GRPCErrorCode) {
26  GRPCErrorCodeCancelled = 1,
27 
32  GRPCErrorCodeUnknown = 2,
33 
40  GRPCErrorCodeInvalidArgument = 3,
41 
49  GRPCErrorCodeDeadlineExceeded = 4,
50 
52  GRPCErrorCodeNotFound = 5,
53 
56  GRPCErrorCodeAlreadyExists = 6,
57 
65  GRPCErrorCodePermissionDenied = 7,
66 
71  GRPCErrorCodeUnauthenticated = 16,
72 
74  GRPCErrorCodeResourceExhausted = 8,
75 
83  GRPCErrorCodeFailedPrecondition = 9,
84 
90  GRPCErrorCodeAborted = 10,
91 
100  GRPCErrorCodeOutOfRange = 11,
101 
104  GRPCErrorCodeUnimplemented = 12,
105 
110  GRPCErrorCodeInternal = 13,
111 
117  GRPCErrorCodeUnavailable = 14,
118 
120  GRPCErrorCodeDataLoss = 15,
121 };
122 
126 typedef NS_ENUM(NSUInteger, GRPCCallSafety) {
131  GRPCCallSafetyDefault = 0,
133  GRPCCallSafetyIdempotentRequest = 1,
138  GRPCCallSafetyCacheableRequest = 2,
139 };
140 
147 typedef NS_ENUM(NSUInteger, GRPCCompressionAlgorithm) {
148  GRPCCompressNone = 0,
149  GRPCCompressDeflate,
150  GRPCCompressGzip,
151  GRPCStreamCompressGzip,
152 };
153 
155 typedef GRPCCompressionAlgorithm GRPCCompressAlgorithm;
156 
158 typedef NS_ENUM(NSUInteger, GRPCTransportType) {
159  GRPCTransportTypeDefault = 0,
161  GRPCTransportTypeChttp2BoringSSL = 0,
163  GRPCTransportTypeCronet,
165  GRPCTransportTypeInsecure,
166 };
167 
169 extern NSString* _Nonnull const kGRPCErrorDomain;
170 
175 extern NSString* _Nonnull const kGRPCHeadersKey;
176 extern NSString* _Nonnull const kGRPCTrailersKey;
177 
179 typedef char* _Nonnull GRPCTransportID;
180 
185 
190 - (void)getTokenWithHandler:(void (^_Nonnull)(NSString* _Nullable token))handler;
191 
192 @end
typedef NS_ENUM(NSUInteger, GRPCErrorCode)
gRPC error codes.
Definition: GRPCTypes.h:24
char *_Nonnull GRPCTransportID
The id of a transport implementation.
Definition: GRPCTypes.h:179
GRPCCompressionAlgorithm GRPCCompressAlgorithm
GRPCCompressAlgorithm is deprecated.
Definition: GRPCTypes.h:152
NSString *_Nonnull const kGRPCTrailersKey
NSString *_Nonnull const kGRPCErrorDomain
Domain of NSError objects produced by gRPC.
NSString *_Nonnull const kGRPCHeadersKey
Keys used in |NSError|'s |userInfo| dictionary to store the response headers and trailers sent by the...
Implement this protocol to provide a token to gRPC when a call is initiated.
Definition: GRPCTypes.h:184