GRPC Objective-C  1.26.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;
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 
83 
84 @end
85 
86 NS_ASSUME_NONNULL_END
instancetype sharedInstance()
The factory to create a transport.
Definition: GRPCTransport.h:52
NSArray< id< GRPCInterceptorFactory > > * transportInterceptorFactories
Get a list of factories for transport inteceptors.
Definition: GRPCTransport.h:58
const GRPCTransportID core_secure
Definition: GRPCTransport.h:32
char *_Nonnull GRPCTransportID
The id of a transport implementation.
Definition: GRPCTypes.h:179
NS_ASSUME_NONNULL_BEGIN const struct GRPCDefaultTransportImplList GRPCDefaultTransportImplList
API for interceptors implementation.
The default transport implementations available in gRPC.
Definition: GRPCTransport.h:31
BOOL TransportIDIsEqual(GRPCTransportID lhs, GRPCTransportID rhs)
Returns whether two transport id&#39;s are identical.
HTTP request parameters.
Definition: GRPCCall.h:102
Immutable user configurable options for a gRPC call.
Definition: GRPCCallOptions.h:30
An object can implement this protocol to receive responses from server from a call.
Definition: GRPCCall.h:50
The GRPCInterceptorInterface defines the request events that can occur to an interceptor.
Definition: GRPCInterceptor.h:130
GRPCTransportManager is a helper class to forward messages between the last interceptor and the trans...
Definition: GRPCTransport+Private.h:50
const GRPCTransportID core_insecure
Definition: GRPCTransport.h:33
NSUInteger TransportIDHash(GRPCTransportID)
Returns the hash value of a transport id.
Base class for transport implementations.
Definition: GRPCTransport.h:82
The registry of transport implementations.
Definition: GRPCTransport.h:63