GRPC Objective-C  1.26.0
GRPCHost.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 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 
21 #import <grpc/impl/codegen/compression_types.h>
22 
23 #import "GRPCChannelFactory.h"
24 
26 
27 NS_ASSUME_NONNULL_BEGIN
28 
29 @class GRPCCompletionQueue;
30 struct grpc_call;
31 struct grpc_channel_credentials;
32 
33 @interface GRPCHost : NSObject
34 
35 + (void)resetAllHostSettings;
36 
37 @property(nonatomic, readonly) NSString *address;
38 @property(nonatomic, copy, nullable) NSString *userAgentPrefix;
39 @property(nonatomic) grpc_compression_algorithm compressAlgorithm;
40 @property(nonatomic) int keepaliveInterval;
41 @property(nonatomic) int keepaliveTimeout;
42 @property(nonatomic) id logContext;
43 @property(nonatomic) BOOL retryEnabled;
44 
45 @property(nonatomic) unsigned int minConnectTimeout;
46 @property(nonatomic) unsigned int initialConnectBackoff;
47 @property(nonatomic) unsigned int maxConnectBackoff;
48 
49 @property(nonatomic) id<GRPCChannelFactory> channelFactory;
50 
53 @property(nonatomic, copy, nullable) NSString *hostNameOverride;
54 
56 @property(nonatomic) NSUInteger responseSizeLimitOverride;
57 
58 - (nullable instancetype)init NS_UNAVAILABLE;
60 + (nullable instancetype)hostWithAddress:(NSString *)address;
61 - (nullable instancetype)initWithAddress:(NSString *)address NS_DESIGNATED_INITIALIZER;
62 - (BOOL)setTLSPEMRootCerts:(nullable NSString *)pemRootCerts
63  withPrivateKey:(nullable NSString *)pemPrivateKey
64  withCertChain:(nullable NSString *)pemCertChain
65  error:(NSError **)errorPtr;
66 
67 @property(atomic) GRPCTransportType transportType;
68 
69 + (GRPCCallOptions *)callOptionsForHost:(NSString *)host;
70 
71 @end
72 
73 NS_ASSUME_NONNULL_END
NSString * hostNameOverride
The following properties should only be modified for testing:
Definition: GRPCHost.h:53
NSString * address
Definition: GRPCHost.h:37
grpc_compression_algorithm compressAlgorithm
Definition: GRPCHost.h:39
unsigned int minConnectTimeout
Definition: GRPCHost.h:45
int keepaliveInterval
Definition: GRPCHost.h:40
This class lets one more easily use |grpc_completion_queue|.
Definition: GRPCCompletionQueue.h:35
NSUInteger responseSizeLimitOverride
The default response size limit is 4MB.
Definition: GRPCHost.h:56
int keepaliveTimeout
Definition: GRPCHost.h:41
Immutable user configurable options for a gRPC call.
Definition: GRPCCallOptions.h:30
BOOL retryEnabled
Definition: GRPCHost.h:43
GRPCTransportType transportType
Definition: GRPCHost.h:67
void resetAllHostSettings()
id logContext
Definition: GRPCHost.h:42
unsigned int initialConnectBackoff
Definition: GRPCHost.h:46
id< GRPCChannelFactory > channelFactory
Definition: GRPCHost.h:49
Definition: GRPCHost.h:33
NSString * userAgentPrefix
Definition: GRPCHost.h:38
unsigned int maxConnectBackoff
Definition: GRPCHost.h:47
nullable instancetype NS_UNAVAILABLE()