Skip to content

Commit 7b48449

Browse files
committed
fix options
1 parent 680987a commit 7b48449

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

client/options.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type CallOptions struct {
8989
CallWrappers []CallWrapper
9090

9191
// 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.
9393
ConnectionTimeout time.Duration
9494
// Request/Response timeout of entire srv.Call, for single request timeout set ConnectionTimeout.
9595
RequestTimeout time.Duration
@@ -261,6 +261,13 @@ func Retry(fn RetryFunc) Option {
261261
}
262262
}
263263

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+
264271
// RequestTimeout set the request timeout.
265272
func RequestTimeout(d time.Duration) Option {
266273
return func(o *Options) {

0 commit comments

Comments
 (0)