From 7b48449a85230470e8fdcdd6204c2571074549dd Mon Sep 17 00:00:00 2001 From: asim Date: Mon, 7 Jul 2025 10:23:23 +0100 Subject: [PATCH] fix options --- client/options.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/options.go b/client/options.go index dcb05dd1..b0fe9434 100644 --- a/client/options.go +++ b/client/options.go @@ -89,7 +89,7 @@ type CallOptions struct { CallWrappers []CallWrapper // ConnectionTimeout of one request to the server. - // Set this lower than the RequestTimeout to enbale retries on connection timeout. + // Set this lower than the RequestTimeout to enable retries on connection timeout. ConnectionTimeout time.Duration // Request/Response timeout of entire srv.Call, for single request timeout set ConnectionTimeout. RequestTimeout time.Duration @@ -261,6 +261,13 @@ func Retry(fn RetryFunc) Option { } } +// ConnectionTimeout sets the connection timeout +func ConnectionTimeout(t time.Duration) Option { + return func(o *Options) { + o.CallOptions.ConnectionTimeout = t + } +} + // RequestTimeout set the request timeout. func RequestTimeout(d time.Duration) Option { return func(o *Options) {