From f7582399ed645fdd8c617e1b7e6b57d5e417227d Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 24 Dec 2021 14:24:13 +0300 Subject: [PATCH] [#107] client: Provide RWTimeout option Signed-off-by: Alex Vanin --- client/opts.go | 8 ++++++++ go.mod | 2 +- go.sum | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/client/opts.go b/client/opts.go index e464faa8..008c0d36 100644 --- a/client/opts.go +++ b/client/opts.go @@ -137,6 +137,14 @@ func WithDialTimeout(dur time.Duration) Option { } } +// WithRWTimeout returns option to set timeout for single read and write +// operation on protobuf message. +func WithRWTimeout(dur time.Duration) Option { + return func(opts *clientOptions) { + opts.rawOpts = append(opts.rawOpts, client.WithRWTimeout(dur)) + } +} + // WithTLSConfig returns option to set connection's TLS config to the remote node. // // Ignored if WithGRPCConnection is provided. diff --git a/go.mod b/go.mod index 72172392..aa785bbc 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/mr-tron/base58 v1.2.0 github.com/nspcc-dev/hrw v1.0.9 github.com/nspcc-dev/neo-go v0.98.0 - github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1 + github.com/nspcc-dev/neofs-api-go/v2 v2.11.1 github.com/nspcc-dev/neofs-crypto v0.3.0 github.com/stretchr/testify v1.7.0 go.uber.org/zap v1.18.1 diff --git a/go.sum b/go.sum index 93137b4a..7fbcae75 100644 --- a/go.sum +++ b/go.sum @@ -176,8 +176,9 @@ github.com/nspcc-dev/hrw v1.0.9/go.mod h1:l/W2vx83vMQo6aStyx2AuZrJ+07lGv2JQGlVkP github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1:pPYwPZ2ks+uMnlRLUyXOpLieaDQSEaf4NM3zHVbRjmg= github.com/nspcc-dev/neo-go v0.98.0 h1:yyW4sgY88/pLf0949qmgfkQXzRKC3CI/WyhqXNnwMd8= github.com/nspcc-dev/neo-go v0.98.0/go.mod h1:E3cc1x6RXSXrJb2nDWXTXjnXk3rIqVN8YdFyWv+FrqM= -github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1 h1:CGA56mhLLduWRuMHcWujP5Ek+gAnXHk0WuIWkG65G1s= github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs= +github.com/nspcc-dev/neofs-api-go/v2 v2.11.1 h1:SVqc523pZsSaS9vnPS1mm3VV6b6xY0gvdA0uYJ/GWZQ= +github.com/nspcc-dev/neofs-api-go/v2 v2.11.1/go.mod h1:oS8dycEh8PPf2Jjp6+8dlwWyEv2Dy77h/XhhcdxYEFs= github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA= github.com/nspcc-dev/neofs-crypto v0.2.3/go.mod h1:8w16GEJbH6791ktVqHN9YRNH3s9BEEKYxGhlFnp0cDw= github.com/nspcc-dev/neofs-crypto v0.3.0 h1:zlr3pgoxuzrmGCxc5W8dGVfA9Rro8diFvVnBg0L4ifM=