Skip to content

Commit a0d5727

Browse files
authored
Add index docc page and fix comment links (#1473)
# Motivation We want to be able to generate proper docc pages. # Modification This PR adds a new index page for the `GRPC` module which is adapting the current `README`. Furthermore, it fixes a bunch of links in the doc comments so that they resolve properly. # Result We can now build better docc pages.
1 parent 3e1521f commit a0d5727

40 files changed

+266
-142
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ package dependency to your `Package.swift`:
5454

5555
```swift
5656
dependencies: [
57-
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.0.0")
57+
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.9.0")
5858
]
5959
```
6060

Sources/GRPC/AsyncAwaitSupport/GRPCAsyncBidirectionalStreamingCall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import NIOHPACK
1919

20-
/// Async-await variant of BidirectionalStreamingCall.
20+
/// Async-await variant of ``BidirectionalStreamingCall``.
2121
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
2222
public struct GRPCAsyncBidirectionalStreamingCall<Request: Sendable, Response: Sendable>: Sendable {
2323
private let call: Call<Request, Response>

Sources/GRPC/AsyncAwaitSupport/GRPCAsyncClientStreamingCall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import NIOHPACK
1919

20-
/// Async-await variant of `ClientStreamingCall`.
20+
/// Async-await variant of ``ClientStreamingCall``.
2121
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
2222
public struct GRPCAsyncClientStreamingCall<Request: Sendable, Response: Sendable>: Sendable {
2323
private let call: Call<Request, Response>

Sources/GRPC/AsyncAwaitSupport/GRPCAsyncRequestStreamWriter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public struct GRPCAsyncRequestStreamWriter<Request: Sendable>: Sendable {
4646
/// before sending another request. Callers who do not need this guarantee do not have to `await`
4747
/// the completion of this call and may send messages concurrently from multiple ``Task``s.
4848
/// However, it is important to note that no more than 16 writes may be pending at any one time
49-
/// and attempting to exceed this will result in an ``GRPCAsyncWriterError.tooManyPendingWrites``
49+
/// and attempting to exceed this will result in an ``GRPCAsyncWriterError/tooManyPendingWrites``
5050
/// error being thrown.
5151
///
5252
/// Callers must call ``finish()`` when they have no more requests left to send.

Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerCallContext.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public struct GRPCAsyncServerCallContext: Sendable {
3232
Response(contextProvider: self.contextProvider)
3333
}
3434

35-
/// Access the `UserInfo` dictionary which is shared with the interceptor contexts for this RPC.
35+
/// Access the ``UserInfo`` dictionary which is shared with the interceptor contexts for this RPC.
3636
///
37-
/// - Important: While `UserInfo` has value-semantics, this function accesses a reference
38-
/// wrapped `UserInfo`. The contexts passed to interceptors provide the same reference. As such
37+
/// - Important: While ``UserInfo`` has value-semantics, this function accesses a reference
38+
/// wrapped ``UserInfo``. The contexts passed to interceptors provide the same reference. As such
3939
/// this may be used as a mechanism to pass information between interceptors and service
4040
/// providers.
4141
public func withUserInfo<Result: Sendable>(
@@ -44,10 +44,10 @@ public struct GRPCAsyncServerCallContext: Sendable {
4444
return try await self.contextProvider.withUserInfo(body)
4545
}
4646

47-
/// Modify the `UserInfo` dictionary which is shared with the interceptor contexts for this RPC.
47+
/// Modify the ``UserInfo`` dictionary which is shared with the interceptor contexts for this RPC.
4848
///
49-
/// - Important: While `UserInfo` has value-semantics, this function accesses a reference
50-
/// wrapped `UserInfo`. The contexts passed to interceptors provide the same reference. As such
49+
/// - Important: While ``UserInfo`` has value-semantics, this function accesses a reference
50+
/// wrapped ``UserInfo``. The contexts passed to interceptors provide the same reference. As such
5151
/// this may be used as a mechanism to pass information between interceptors and service
5252
/// providers.
5353
public func withMutableUserInfo<Result: Sendable>(

Sources/GRPC/AsyncAwaitSupport/GRPCAsyncServerStreamingCall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import NIOHPACK
1919

20-
/// Async-await variant of `ServerStreamingCall`.
20+
/// Async-await variant of ``ServerStreamingCall``.
2121
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
2222
public struct GRPCAsyncServerStreamingCall<Request: Sendable, Response: Sendable> {
2323
private let call: Call<Request, Response>

Sources/GRPC/AsyncAwaitSupport/GRPCAsyncUnaryCall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import NIOHPACK
1919

2020
/// A unary gRPC call. The request is sent on initialization.
2121
///
22-
/// Note: while this object is a `struct`, its implementation delegates to `Call`. It therefore
22+
/// Note: while this object is a `struct`, its implementation delegates to ``Call``. It therefore
2323
/// has reference semantics.
2424
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
2525
public struct GRPCAsyncUnaryCall<Request: Sendable, Response: Sendable>: Sendable {

Sources/GRPC/CallHandlers/ClientStreamingServerHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public final class ClientStreamingServerHandler<
4343
@usableFromInline
4444
internal let context: CallHandlerContext
4545

46-
/// A reference to a `UserInfo`.
46+
/// A reference to a ``UserInfo``.
4747
@usableFromInline
4848
internal let userInfoRef: Ref<UserInfo>
4949

Sources/GRPC/CallHandlers/ServerHandlerProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import NIOHPACK
2020
/// On receiving a new RPC, gRPC will ask all available service providers for an instance of this
2121
/// protocol in order to handle the RPC.
2222
///
23-
/// See also: `CallHandlerProvider.handle(method:context:)`
23+
/// See also: ``CallHandlerProvider/handle(method:context:)``.
2424
public protocol GRPCServerHandlerProtocol {
2525
/// Called when request headers have been received at the start of an RPC.
2626
/// - Parameter metadata: The request headers.

Sources/GRPC/CallOptions.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ public struct CallOptions: GRPCSendable {
4141
/// for the remote peer to use for encoding responses.
4242
///
4343
/// Compression may also be disabled at the message-level for streaming requests (i.e. client
44-
/// streaming and bidirectional streaming RPCs) by setting `compression` to `.disabled` in
45-
/// `sendMessage(_:compression)`, `sendMessage(_:compression:promise)`,
46-
/// `sendMessages(_:compression)` or `sendMessages(_:compression:promise)`.
44+
/// streaming and bidirectional streaming RPCs) by setting `compression` to ``Compression/disabled`` in
45+
/// ``StreamingRequestClientCall/sendMessage(_:compression:)-uvtc``,
46+
/// ``StreamingRequestClientCall/sendMessage(_:compression:promise:)`` ,
47+
/// ``StreamingRequestClientCall/sendMessages(_:compression:)-55vb3`` or
48+
/// ``StreamingRequestClientCall/sendMessage(_:compression:promise:)`.
4749
///
4850
/// Note that enabling `compression` via the `sendMessage` or `sendMessages` methods only applies
4951
/// if encoding has been specified in these options.
@@ -52,20 +54,20 @@ public struct CallOptions: GRPCSendable {
5254
/// Whether the call is cacheable.
5355
public var cacheable: Bool
5456

55-
/// How IDs should be provided for requests. Defaults to `.autogenerated`.
57+
/// How IDs should be provided for requests. Defaults to ``RequestIDProvider-swift.struct/autogenerated``.
5658
///
5759
/// The request ID is used for logging and will be added to the headers of a call if
5860
/// `requestIDHeader` is specified.
5961
///
60-
/// - Important: When setting `CallOptions` at the client level, `.userDefined` should __not__ be
62+
/// - Important: When setting ``CallOptions`` at the client level, ``RequestIDProvider-swift.struct/userDefined(_:)`` should __not__ be
6163
/// used otherwise each request will have the same ID.
6264
public var requestIDProvider: RequestIDProvider
6365

6466
/// The name of the header to use when adding a request ID to a call, e.g. "x-request-id". If the
6567
/// value is `nil` (the default) then no additional header will be added.
6668
///
6769
/// Setting this value will add a request ID to the headers of the call these options are used
68-
/// with. The request ID will be provided by `requestIDProvider` and will also be used in log
70+
/// with. The request ID will be provided by ``requestIDProvider-swift.property`` and will also be used in log
6971
/// messages associated with the call.
7072
public var requestIDHeader: String?
7173

@@ -81,7 +83,7 @@ public struct CallOptions: GRPCSendable {
8183

8284
/// A logger used for the call. Defaults to a no-op logger.
8385
///
84-
/// If a `requestIDProvider` exists then a request ID will automatically attached to the logger's
86+
/// If a ``requestIDProvider-swift.property`` exists then a request ID will automatically attached to the logger's
8587
/// metadata using the 'grpc-request-id' key.
8688
public var logger: Logger
8789

@@ -166,7 +168,7 @@ extension CallOptions {
166168

167169
/// Specify an ID to be used.
168170
///
169-
/// - Important: this should only be used when `CallOptions` are passed directly to the call.
171+
/// - Important: this should only be used when ``CallOptions`` are passed directly to the call.
170172
/// If it is used for the default options on a client then all calls with have the same ID.
171173
public static func userDefined(_ requestID: String) -> RequestIDProvider {
172174
return RequestIDProvider(.static(requestID))

0 commit comments

Comments
 (0)