GRPC Objective-C  1.71.0
GRPCTransport.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 // The interface for a transport implementation
20 
21 #import "GRPCInterceptor.h"
22 
23 NS_ASSUME_NONNULL_BEGIN
24 
25 #pragma mark Transport ID
26 
31 extern const struct GRPCDefaultTransportImplList {
35 
38 
41 
42 #pragma mark Transport and factory
43 
44 @protocol GRPCInterceptorInterface;
45 @protocol GRPCResponseHandler;
46 @class GRPCTransportManager;
47 @class GRPCRequestOptions;
48 @class GRPCCallOptions;
49 @class GRPCTransport;
50 
52 @protocol GRPCTransportFactory <NSObject>
53 
55 - (GRPCTransport *)createTransportWithManager:(GRPCTransportManager *)transportManager;
56 
58 @property(nonatomic, readonly) NSArray<id<GRPCInterceptorFactory>> *transportInterceptorFactories;
59 
60 @end
61 
63 @interface GRPCTransportRegistry : NSObject
64 
65 + (instancetype)sharedInstance;
66 
73 - (void)registerTransportWithID:(GRPCTransportID)transportID
74  factory:(id<GRPCTransportFactory>)factory;
75 
76 @end
77 
82 @interface GRPCTransport : NSObject <GRPCInterceptorInterface>
83 
84 @end
85 
86 NS_ASSUME_NONNULL_END
GRPCTransportFactory-p::transportInterceptorFactories
NSArray< id< GRPCInterceptorFactory > > * transportInterceptorFactories
Get a list of factories for transport inteceptors.
Definition: GRPCTransport.h:58
GRPCTransportRegistry
The registry of transport implementations.
Definition: GRPCTransport.h:63
GRPCCallOptions
Immutable user configurable options for a gRPC call.
Definition: GRPCCallOptions.h:32
GRPCInterceptorInterface-p
The GRPCInterceptorInterface defines the request events that can occur to an interceptor.
Definition: GRPCInterceptor.h:130
GRPCDefaultTransportImplList
The default transport implementations available in gRPC.
Definition: GRPCTransport.h:31
GRPCTransport
Base class for transport implementations.
Definition: GRPCTransport.h:82
+[GRPCTransportRegistry sharedInstance]
instancetype sharedInstance()
GRPCDefaultTransportImplList
NS_ASSUME_NONNULL_BEGIN const struct GRPCDefaultTransportImplList GRPCDefaultTransportImplList
GRPCTransportFactory-p
The factory to create a transport.
Definition: GRPCTransport.h:52
TransportIDIsEqual
BOOL TransportIDIsEqual(GRPCTransportID lhs, GRPCTransportID rhs)
Returns whether two transport id's are identical.
TransportIDHash
NSUInteger TransportIDHash(GRPCTransportID)
Returns the hash value of a transport id.
GRPCDefaultTransportImplList::core_insecure
const GRPCTransportID core_insecure
Definition: GRPCTransport.h:33
GRPCTransportID
const typedef char *_Nonnull GRPCTransportID
The id of a transport implementation.
Definition: GRPCTypes.h:174
GRPCInterceptor.h
GRPCDefaultTransportImplList::core_secure
const GRPCTransportID core_secure
Definition: GRPCTransport.h:32
GRPCRequestOptions
HTTP request parameters.
Definition: GRPCCall.h:102
GRPCResponseHandler-p
An object can implement this protocol to receive responses from server from a call.
Definition: GRPCCall.h:50