Skip to content

Commit 4099a1e

Browse files
committed
Reference style links
1 parent 83b33ec commit 4099a1e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Documentation/grpc-metadata.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Server side metadata sending and receiving examples are available [here](../exam
169169
### Receiving metadata
170170

171171
To read metadata sent by the client, the server needs to retrieve it from RPC
172-
context using [FromIncomingContext](https://pkg.go.dev/google.golang.org/grpc/metadata#FromIncomingContext).
172+
context using [FromIncomingContext][1].
173173
If it is a unary call, the RPC handler's context can be used.
174174
For streaming calls, the server needs to get context from the stream.
175175

@@ -196,8 +196,8 @@ func (s *server) SomeStreamingRPC(stream pb.Service_SomeStreamingRPCServer) erro
196196
#### Unary call
197197

198198
To send header and trailer to client in unary call, the server can call
199-
[SendHeader](https://godoc.org/google.golang.org/grpc#SendHeader) and [SetTrailer](https://godoc.org/google.golang.org/grpc#SetTrailer)
200-
functions in module [grpc](https://godoc.org/google.golang.org/grpc).
199+
[SendHeader][2] and [SetTrailer][3] functions in module
200+
[grpc](https://godoc.org/google.golang.org/grpc).
201201
These two functions take a context as the first parameter.
202202
It should be the RPC handler's context or one derived from it:
203203

@@ -214,7 +214,9 @@ func (s *server) SomeRPC(ctx context.Context, in *pb.someRequest) (*pb.someRespo
214214

215215
#### Streaming call
216216

217-
For streaming calls, header and trailer can be sent using function [SendHeader](https://godoc.org/google.golang.org/grpc#SendHeader) and [SetTrailer](https://godoc.org/google.golang.org/grpc#SetTrailer) in interface [ServerStream](https://godoc.org/google.golang.org/grpc#ServerStream):
217+
For streaming calls, header and trailer can be sent using function
218+
[SendHeader][2] and [SetTrailer][3] in interface
219+
[ServerStream](https://godoc.org/google.golang.org/grpc#ServerStream):
218220

219221
```go
220222
func (s *server) SomeStreamingRPC(stream pb.Service_SomeStreamingRPCServer) error {
@@ -228,10 +230,15 @@ func (s *server) SomeStreamingRPC(stream pb.Service_SomeStreamingRPCServer) erro
228230
```
229231

230232
Do not use
231-
[FromOutgoingContext](https://pkg.go.dev/google.golang.org/grpc/metadata#FromOutgoingContext) on the server to write metadata to be sent to the client.
232-
[FromOutgoingContext](https://pkg.go.dev/google.golang.org/grpc/metadata#FromOutgoingContext) is for client-side use only.
233+
[FromOutgoingContext][4] on the server to write metadata to be sent to the client.
234+
[FromOutgoingContext][4] is for client-side use only.
233235

234236
## Updating metadata from a server interceptor
235237

236238
An example for updating metadata from a server interceptor is
237239
available [here](../examples/features/metadata_interceptor/server/main.go).
240+
241+
[1]: <https://pkg.go.dev/google.golang.org/grpc/metadata#FromIncomingContext> "FromIncomingContext"
242+
[2]: <https://godoc.org/google.golang.org/grpc#SendHeader> "SendHeader"
243+
[3]: https://godoc.org/google.golang.org/grpc#SetTrailer "SetTrailer"
244+
[4]: https://pkg.go.dev/google.golang.org/grpc/metadata#FromOutgoingContext "FromOutgoingContext"

0 commit comments

Comments
 (0)