Skip to content

Commit 869fe81

Browse files
authored
Add missing documentation bundles (#32)
1 parent 33b362b commit 869fe81

File tree

5 files changed

+79
-1
lines changed

5 files changed

+79
-1
lines changed

.spi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 1
22
builder:
33
configs:
4-
- documentation_targets: [GRPCHealthService, GRPCOTelTracingInterceptors]
4+
- documentation_targets: [GRPCHealthService, GRPCInteropTests, GRPCReflectionService, GRPCOTelTracingInterceptors, GRPCServiceLifecycle]
55
swift_version: 6.0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# ``GRPCInteropTests``
2+
3+
This module contains implementations for gRPC interoperability tests.
4+
5+
## Overview
6+
You can find more information on gRPC interoperability tests by looking at [gRPC's Interoperability Test Case Description](https://github.com/grpc/grpc/blob/ed39aad1b2d0d5f8a6841da5a63285d434308e9a/doc/interop-test-descriptions.md).
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# ``GRPCOTelTracingInterceptors``
2+
3+
This module contains client and server tracing interceptors adhering to OpenTelemetry's
4+
recommendations on tracing.
5+
6+
## Overview
7+
8+
You can read more on this topic at [OpenTelemetry's documentation](https://opentelemetry.io/docs).
9+
Some relevant pages listing which attributes and events you can expect on your spans include:
10+
- [RPC Spans](https://opentelemetry.io/docs/specs/semconv/rpc/rpc-spans)
11+
- [gRPC conventions](https://opentelemetry.io/docs/specs/semconv/rpc/grpc)
12+
13+
You can set up a client interceptor like so during your bootstrapping phase:
14+
15+
```swift
16+
// Create the client interceptor
17+
let interceptor = ClientOTelTracingInterceptor(
18+
serverHostname: "someserver.com",
19+
networkTransportMethod: "tcp"
20+
)
21+
22+
// Add it as an interceptor when creating your client
23+
let client = GRPCClient(
24+
transport: transport,
25+
interceptors: [interceptor]
26+
)
27+
28+
// Finally run your client
29+
try await client.runConnections()
30+
```
31+
32+
You can similarly add the server interceptor to your server like this:
33+
34+
```swift
35+
// Create the server interceptor
36+
let interceptor = ServerOTelTracingInterceptor(
37+
serverHostname: "someserver.com",
38+
networkTransportMethod: "tcp"
39+
)
40+
41+
// Add it as an interceptor when creating your server
42+
let server = GRPCServer(
43+
transport: transport,
44+
services: [TestService()],
45+
interceptors: interceptor
46+
)
47+
48+
// Finally run your server
49+
try await server.serve()
50+
```
51+
52+
For more information, look at the documentation for:
53+
- ``GRPCOTelTracingInterceptors/ClientOTelTracingInterceptor``,
54+
- ``GRPCOTelTracingInterceptors/ServerOTelTracingInterceptor``,
55+
- [Client Interceptors](https://swiftpackageindex.com/grpc/grpc-swift/documentation/grpccore/clientinterceptor),
56+
- [Server Interceptors](https://swiftpackageindex.com/grpc/grpc-swift/documentation/grpccore/serverinterceptor)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ``GRPCReflectionService``
2+
3+
This module contains an implementation of the gRPC Reflection service
4+
("grpc.reflection.v1.ServerReflection").
5+
6+
## Overview
7+
8+
The reflection service is a regular gRPC service providing information about other services.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ``GRPCServiceLifecycle``
2+
3+
This module conforms `GRPCClient` and `GRPCServer` to the `Service` protocol of `SwiftServiceLifecycle`,
4+
to allow for easy composition.
5+
6+
## Overview
7+
8+
For more information on `SwiftServiceLifecycle`, [see its documentation](https://swiftpackageindex.com/swift-server/swift-service-lifecycle/documentation/servicelifecycle).

0 commit comments

Comments
 (0)