[#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:
Leonard Lyubich 2020-11-23 14:05:27 +03:00 committed by Alex Vanin
parent 03ac6bedb4
commit 5ee500bb43
6 changed files with 23 additions and 8 deletions

View file

@ -97,8 +97,9 @@ func v2NetmapClientFromOptions(opts *clientOptions) (cli *v2netmap.Client, err e
case opts.addr != "":
cli, err = v2netmap.NewClient(v2netmap.WithGlobalOpts(
client.WithNetworkAddress(opts.addr)),
)
client.WithNetworkAddress(opts.addr),
client.WithDialTimeout(opts.dialTimeout),
))
default:
return nil, errOptionsLack("Netmap")