Get rid of `Option` pattern. Define `Init`, `Dial` and `Close` methods
for the corresponding stages of use.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
In previous implementation we wrote up to 4KB payload chunk per-call.
This led to sending a large number of messages with a large
amount of payload.
Increase buffer length limit to 3MB.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Use call private key parameterized in `HeadObject` / `DeleteObject`
methods of `Pool` as corresponding key for `ObjectHead` / `ObjectDelete`
methods of `Client`.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
From now session token for `SetEACL` operation should be written into
eACL table structure (similar to `PutContainer`).
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Call `createSessionTokenForDuration` function for session opening in
`pool.openDefaultSession` method in order to limit session lifetime
according to pool configuration (`SessionExpirationDuration`).
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Based on the applications that use pool, most of them simply
set session token duration to MaxUint64 value. It is completely
understandable, because epochs are incrementing and expiration
value will be surpassed sooner or later, unless it is MaxUint64.
As an alternative I suggest specifying duration instead of
absolute epoch values. Now apps can set duration of 100-200
epochs and pool automatically calculated expiration epoch
base on the network info.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
PutContainer method takes `container.Container` structure
as an argument. This structure already contains session
token field, so there is no need in `prmSession` because it
duplicates session token definition.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This is done to prevent import cycles when `object` package needs any other
that requires `object.ID` or `object.Address`.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Define `XPrm` type for each `X` client operation which structures
parameters. Export setters of each parameterized value. Emphasize that
some parameters are required. Make the client panic when the parameters
are incorrectly set. Get rid of vadiadic call options and `CallOption`
type. Improve documentation of client behavior.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Default session token is created for object service requests
and should not be reused in container or any other service requests.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Since we transformed the pool of gRPC connection into the pool of
neofs clients, we don't need to call EndpointInfo to fetch the
address of the node for the beautiful error output.
Moreover it is done incorrectly, because c.CreateSession may return
context.Cancelled error (graceful shutdown). We will reuse the same
context for the EndpointInfo call which will lead to a
timeout freeze.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>