GRPC Objective-C  1.39.1
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 
19 #import <Foundation/Foundation.h>
20 
26 typedef NS_ENUM(NSUInteger, GRPCErrorCode) {
28  GRPCErrorCodeCancelled = 1,
29 
34  GRPCErrorCodeUnknown = 2,
35 
42  GRPCErrorCodeInvalidArgument = 3,
43 
51  GRPCErrorCodeDeadlineExceeded = 4,
52 
54  GRPCErrorCodeNotFound = 5,
55 
58  GRPCErrorCodeAlreadyExists = 6,
59 
67  GRPCErrorCodePermissionDenied = 7,
68 
73  GRPCErrorCodeUnauthenticated = 16,
74 
76  GRPCErrorCodeResourceExhausted = 8,
77 
85  GRPCErrorCodeFailedPrecondition = 9,
86 
92  GRPCErrorCodeAborted = 10,
93 
102  GRPCErrorCodeOutOfRange = 11,
103 
106  GRPCErrorCodeUnimplemented = 12,
107 
112  GRPCErrorCodeInternal = 13,
113 
119  GRPCErrorCodeUnavailable = 14,
120 
122  GRPCErrorCodeDataLoss = 15,
123 };
124 
128 typedef NS_ENUM(NSUInteger, GRPCCallSafety) {
133  GRPCCallSafetyDefault = 0,
135  GRPCCallSafetyIdempotentRequest = 1,
140  GRPCCallSafetyCacheableRequest = 2,
141 };
142 
149 typedef NS_ENUM(NSUInteger, GRPCCompressionAlgorithm) {
150  GRPCCompressNone = 0,
151  GRPCCompressDeflate,
152  GRPCCompressGzip,
153  GRPCStreamCompressGzip,
154 };
155 
157 typedef GRPCCompressionAlgorithm GRPCCompressAlgorithm;
158 
160 typedef NS_ENUM(NSUInteger, GRPCTransportType) {
161  GRPCTransportTypeDefault = 0,
163  GRPCTransportTypeChttp2BoringSSL = 0,
165  GRPCTransportTypeCronet,
167  GRPCTransportTypeInsecure,
168 };
169 
171 extern NSString* _Nonnull const kGRPCErrorDomain;
172 
177 extern NSString* _Nonnull const kGRPCHeadersKey;
178 extern NSString* _Nonnull const kGRPCTrailersKey;
179 
181 typedef char* _Nonnull GRPCTransportID;
182 
187 
192 - (void)getTokenWithHandler:(void (^_Nonnull)(NSString* _Nullable token))handler;
193 
194 @end
typedef NS_ENUM(NSUInteger, GRPCErrorCode)
gRPC error codes.
Definition: GRPCTypes.h:26
char *_Nonnull GRPCTransportID
The id of a transport implementation.
Definition: GRPCTypes.h:181
GRPCCompressionAlgorithm GRPCCompressAlgorithm
GRPCCompressAlgorithm is deprecated.
Definition: GRPCTypes.h:154
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:186