File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ type CallOptions struct {
89
89
CallWrappers []CallWrapper
90
90
91
91
// ConnectionTimeout of one request to the server.
92
- // Set this lower than the RequestTimeout to enbale retries on connection timeout.
92
+ // Set this lower than the RequestTimeout to enable retries on connection timeout.
93
93
ConnectionTimeout time.Duration
94
94
// Request/Response timeout of entire srv.Call, for single request timeout set ConnectionTimeout.
95
95
RequestTimeout time.Duration
@@ -261,6 +261,13 @@ func Retry(fn RetryFunc) Option {
261
261
}
262
262
}
263
263
264
+ // ConnectionTimeout sets the connection timeout
265
+ func ConnectionTimeout (t time.Duration ) Option {
266
+ return func (o * Options ) {
267
+ o .CallOptions .ConnectionTimeout = t
268
+ }
269
+ }
270
+
264
271
// RequestTimeout set the request timeout.
265
272
func RequestTimeout (d time.Duration ) Option {
266
273
return func (o * Options ) {
You can’t perform that action at this time.
0 commit comments