[#107] client: Provide RWTimeout option

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-12-24 14:24:13 +03:00 committed by Alex Vanin
parent 2fd5802c48
commit f7582399ed
3 changed files with 9 additions and 1 deletions

View file

@ -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.

2
go.mod
View file

@ -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

BIN
go.sum

Binary file not shown.