forked from TrueCloudLab/frostfs-api-go
[#205] sdk/client: Support option to set dial timeout
There is a need to set dial timeout in SDK client that is used in case of internal connection opening. Add DialTimeout option constructor to support this feature. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
03ac6bedb4
commit
5ee500bb43
6 changed files with 23 additions and 8 deletions
|
@ -97,8 +97,9 @@ func v2SessionClientFromOptions(opts *clientOptions) (cli *v2session.Client, err
|
|||
|
||||
case opts.addr != "":
|
||||
cli, err = v2session.NewClient(v2session.WithGlobalOpts(
|
||||
client.WithNetworkAddress(opts.addr)),
|
||||
)
|
||||
client.WithNetworkAddress(opts.addr),
|
||||
client.WithDialTimeout(opts.dialTimeout),
|
||||
))
|
||||
|
||||
default:
|
||||
return nil, errOptionsLack("Session")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue