Skip to content

Commit 21b739d

Browse files
committed
Update generated docs and tidy formatting
1 parent 55cbad3 commit 21b739d

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

DOC.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Here's an example for client side chaining:
4242

4343
These interceptors will be executed from left to right: monitoring and then retry logic.
4444

45+
The retry interceptor will call every interceptor that follows it whenever when a retry happens.
46+
4547
### Writing Your Own
4648
Implementing your own interceptor is pretty trivial: there are interfaces for that. But the interesting
4749
bit exposing common data to handlers (and other middleware), similarly to HTTP Middleware design.
@@ -84,7 +86,7 @@ needed. For example:
8486
#### <a name="pkg-files">Package files</a>
8587
[chain.go](./chain.go) [doc.go](./doc.go) [wrappers.go](./wrappers.go)
8688

87-
## <a name="ChainStreamClient">func</a> [ChainStreamClient](./chain.go#L130)
89+
## <a name="ChainStreamClient">func</a> [ChainStreamClient](./chain.go#L136)
8890
``` go
8991
func ChainStreamClient(interceptors ...grpc.StreamClientInterceptor) grpc.StreamClientInterceptor
9092
```
@@ -93,7 +95,7 @@ ChainStreamClient creates a single interceptor out of a chain of many intercepto
9395
Execution is done in left-to-right order, including passing of context.
9496
For example ChainStreamClient(one, two, three) will execute one before two before three.
9597

96-
## <a name="ChainStreamServer">func</a> [ChainStreamServer](./chain.go#L56)
98+
## <a name="ChainStreamServer">func</a> [ChainStreamServer](./chain.go#L58)
9799
``` go
98100
func ChainStreamServer(interceptors ...grpc.StreamServerInterceptor) grpc.StreamServerInterceptor
99101
```
@@ -103,7 +105,7 @@ Execution is done in left-to-right order, including passing of context.
103105
For example ChainUnaryServer(one, two, three) will execute one before two before three.
104106
If you want to pass context between interceptors, use WrapServerStream.
105107

106-
## <a name="ChainUnaryClient">func</a> [ChainUnaryClient](./chain.go#L93)
108+
## <a name="ChainUnaryClient">func</a> [ChainUnaryClient](./chain.go#L97)
107109
``` go
108110
func ChainUnaryClient(interceptors ...grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor
109111
```
@@ -122,14 +124,14 @@ Execution is done in left-to-right order, including passing of context.
122124
For example ChainUnaryServer(one, two, three) will execute one before two before three, and three
123125
will see context changes of one and two.
124126

125-
## <a name="WithStreamServerChain">func</a> [WithStreamServerChain](./chain.go#L173)
127+
## <a name="WithStreamServerChain">func</a> [WithStreamServerChain](./chain.go#L181)
126128
``` go
127129
func WithStreamServerChain(interceptors ...grpc.StreamServerInterceptor) grpc.ServerOption
128130
```
129131
WithStreamServerChain is a grpc.Server config option that accepts multiple stream interceptors.
130132
Basically syntactic sugar.
131133

132-
## <a name="WithUnaryServerChain">func</a> [WithUnaryServerChain](./chain.go#L167)
134+
## <a name="WithUnaryServerChain">func</a> [WithUnaryServerChain](./chain.go#L175)
133135
``` go
134136
func WithUnaryServerChain(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption
135137
```

retry/DOC.md

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ override the number of retries (setting them to more than 0) with a `grpc.Client
2020
Other default options are: retry on `ResourceExhausted` and `Unavailable` gRPC codes, use a 50ms
2121
linear backoff with 10% jitter.
2222

23+
For chained interceptors, the retry interceptor will call every interceptor that follows it
24+
whenever when a retry happens.
25+
2326
Please see examples for more advanced use.
2427

2528
## <a name="pkg-imports">Imported Packages</a>

retry/retry_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ func TestChainedRetrySuite(t *testing.T) {
278278
preRetryInterceptor := &trackedInterceptor{}
279279
postRetryInterceptor := &trackedInterceptor{}
280280
s := &ChainedRetrySuite{
281-
srv: service,
282-
preRetryInterceptor: preRetryInterceptor,
281+
srv: service,
282+
preRetryInterceptor: preRetryInterceptor,
283283
postRetryInterceptor: postRetryInterceptor,
284284
InterceptorTestSuite: &grpc_testing.InterceptorTestSuite{
285285
TestService: service,
@@ -294,8 +294,8 @@ func TestChainedRetrySuite(t *testing.T) {
294294

295295
type ChainedRetrySuite struct {
296296
*grpc_testing.InterceptorTestSuite
297-
srv *failingService
298-
preRetryInterceptor *trackedInterceptor
297+
srv *failingService
298+
preRetryInterceptor *trackedInterceptor
299299
postRetryInterceptor *trackedInterceptor
300300
}
301301

0 commit comments

Comments
 (0)