Commit graph

15 commits

Author SHA1 Message Date
Leonard Lyubich
da89c2b71f [#337] client: Add option to specify callback of response information
There is a need to analyze some response information in API client.

Define `ResponseMetaInfo` structure of response information. Add
`WithResponseInfoHandler` client option which allows to set the response
info callback. The callback is called right after any response is received.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-28 18:15:29 +03:00
Evgenii Stratonikov
9ddfcdfbba [#277] go.mod: remove pkg/errors
Use stdlib `errors` instead.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-05-19 11:14:56 +03:00
Leonard Lyubich
a43175e2ea [#263] pkg/client: Split interface method's declarations with linebreaks
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-03-17 14:03:49 +03:00
Leonard Lyubich
c819909906 [#263] pkg/client: Refactor the client to use raw protobuf client
Make `Client` to be the wrapper over raw protobuf client. Provide public
method to get the underlying raw client. Change implementations of all
methods with the new approach of the RPC execution.

Additional changes:
 * key replaced from `New` argument to `WithDefaultPrivateKey` option;
 * `GetSelfBalance` is removed as non-viable;
 * `GetEACLWithSignature` is removed, `GetEACL` returns `EACLWithSignature`;
 * `AttachSessionToken` / `AttachBearerToken` are removed as non-viable;
 * redundant options are removed.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-03-17 14:03:49 +03:00
Evgenii Stratonikov
ae2fb263f1 [#266] pkg/client: Export Client interface instead of structure
Make it easier to test API clients and mock specific methods.
Also add comments on exported methods.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-03-17 13:43:22 +03:00
Evgenii Stratonikov
64505180b4 [#261] pkg/client: Provide signing key in call options
Allow to reuse underlying connection for requests
with different key. If no key is specified the one
provided on client creation is used.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-03-12 10:40:10 +03:00
Leonard Lyubich
8529aa2a93 [#259] pkg/client: Add NetworkInfo method
Implement NetworkInfo method that performs NeoFS API NetmapService
NetworkInfo RPC.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-19 16:25:53 +03:00
Leonard Lyubich
5ee500bb43 [#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>
2020-11-23 14:15:42 +03:00
Leonard Lyubich
0620a3b1eb [#199] sdk/client: Correct linter's remarks
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-16 18:51:14 +03:00
Leonard Lyubich
2bcbd48972 [#197] sdk: Rename getters of Version type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-16 11:52:21 +03:00
Alex Vanin
874a4b937f [#193] pkg/client: Fix error message typos
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-11-13 12:28:00 +03:00
Leonard Lyubich
162b0de725 [#189] sdk/client: Return NodeInfo SDK type from EndpointInfo method
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-06 09:28:50 +03:00
Leonard Lyubich
2b171e1617 [#188] sdk: Implement Epoch method
Implement Epoch method on Client that receives epoch number through Netmap
.LocalNodeInfo call.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-05 09:58:21 +03:00
Leonard Lyubich
805ad54f41 [#180] sdk/client: Make defaultOptions func a Client method
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-28 12:15:49 +03:00
Alex Vanin
d3e3889425 [#167] sdk/client: Add endpoint info getter
Adds support of new netmap service to the SDK client.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-09 09:15:34 +03:00