@@ -42,6 +42,8 @@ Here's an example for client side chaining:
42
42
43
43
These interceptors will be executed from left to right: monitoring and then retry logic.
44
44
45
+ The retry interceptor will call every interceptor that follows it whenever when a retry happens.
46
+
45
47
### Writing Your Own
46
48
Implementing your own interceptor is pretty trivial: there are interfaces for that. But the interesting
47
49
bit exposing common data to handlers (and other middleware), similarly to HTTP Middleware design.
@@ -84,7 +86,7 @@ needed. For example:
84
86
#### <a name =" pkg-files " >Package files</a >
85
87
[ chain.go] ( ./chain.go ) [ doc.go] ( ./doc.go ) [ wrappers.go] ( ./wrappers.go )
86
88
87
- ## <a name =" ChainStreamClient " >func</a > [ ChainStreamClient] ( ./chain.go#L130 )
89
+ ## <a name =" ChainStreamClient " >func</a > [ ChainStreamClient] ( ./chain.go#L136 )
88
90
``` go
89
91
func ChainStreamClient (interceptors ...grpc .StreamClientInterceptor ) grpc .StreamClientInterceptor
90
92
```
@@ -93,7 +95,7 @@ ChainStreamClient creates a single interceptor out of a chain of many intercepto
93
95
Execution is done in left-to-right order, including passing of context.
94
96
For example ChainStreamClient(one, two, three) will execute one before two before three.
95
97
96
- ## <a name="ChainStreamServer">func</a> [ChainStreamServer](./chain.go#L56 )
98
+ ## <a name="ChainStreamServer">func</a> [ChainStreamServer](./chain.go#L58 )
97
99
``` go
98
100
func ChainStreamServer(interceptors ...grpc.StreamServerInterceptor) grpc.StreamServerInterceptor
99
101
```
@@ -103,7 +105,7 @@ Execution is done in left-to-right order, including passing of context.
103
105
For example ChainUnaryServer(one, two, three) will execute one before two before three.
104
106
If you want to pass context between interceptors, use WrapServerStream.
105
107
106
- ## <a name="ChainUnaryClient">func</a> [ChainUnaryClient](./chain.go#L93 )
108
+ ## <a name="ChainUnaryClient">func</a> [ChainUnaryClient](./chain.go#L97 )
107
109
``` go
108
110
func ChainUnaryClient(interceptors ...grpc.UnaryClientInterceptor) grpc.UnaryClientInterceptor
109
111
```
@@ -122,14 +124,14 @@ Execution is done in left-to-right order, including passing of context.
122
124
For example ChainUnaryServer(one, two, three) will execute one before two before three, and three
123
125
will see context changes of one and two.
124
126
125
- ## <a name="WithStreamServerChain">func</a> [WithStreamServerChain](./chain.go#L173 )
127
+ ## <a name="WithStreamServerChain">func</a> [WithStreamServerChain](./chain.go#L181 )
126
128
``` go
127
129
func WithStreamServerChain(interceptors ...grpc.StreamServerInterceptor) grpc.ServerOption
128
130
```
129
131
WithStreamServerChain is a grpc.Server config option that accepts multiple stream interceptors.
130
132
Basically syntactic sugar.
131
133
132
- ## <a name="WithUnaryServerChain">func</a> [WithUnaryServerChain](./chain.go#L167 )
134
+ ## <a name="WithUnaryServerChain">func</a> [WithUnaryServerChain](./chain.go#L175 )
133
135
``` go
134
136
func WithUnaryServerChain(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption
135
137
```
0 commit comments