Commit graph

14 commits

Author SHA1 Message Date
45358d4551 [#2] rpc/client: Allow to override low-level gRPC options
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-02-06 11:30:33 +03:00
cc8da15242 [#2] rpc/client: Remove additional wrapper
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-02-06 11:30:33 +03:00
1351b6656d Move to frostfs-api
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2022-12-12 17:40:48 +03:00
Leonard Lyubich
3a91383f24 [#419] rpc/client: Use provided context for client dial
In previous implementation `Client` passed `context.Background()` to
`grpc.DialContext` function. This didn't allow to abort dial stage by
the given context.

Base dial context on the one provided with `WithContext` option. Fall
back to using `context.Background` if context is not specified.

Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
2022-10-05 13:35:43 +04:00
Leonard Lyubich
2b89b7e798 [#419] rpc/client: Block until client connection is up
In previous implementation `Client` didn't block until the connection is
up on dial stage. This caused the dial timeout to have no effect.

Provide `WithBlock` dial option to `DialContext` call in `openGRPCConn`
method. From now `Client` blocks for configured timeout until the
connection is up.

Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
2022-10-05 13:35:43 +04:00
Leonard Lyubich
504e427c18 [#417] rpc/client: Do not use deprecated code elements
`grpc.WithInsecure` has been marked as deprecated in earlier releases of
`google.golang.org/grpc`.

Use `google.golang.org/grpc/credentials/insecure` package instead as
recommended.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-09-23 10:30:59 +04:00
Evgenii Stratonikov
50382114f4 [#383] rpc/client: Export URI-parsing function
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-10 19:16:42 +03:00
Alex Vanin
49db0cfa03 [#366] rpc/client: Inherit read-write gRPC timeout from client
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-28 12:49:31 +03:00
Leonard Lyubich
25da5d2e13 Add v2 version to go module name
Replace all elements from `v2` to root directory.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-17 15:29:33 +03:00
Pavel Karpy
52c1c4c5ab [#290] client: Add WithURIAddress option
Add `WithURIAddress` option to client.
It parses passed address with
`url.ParseRequestURI` function and
use(or not) TLS over grpc connection
based on retrieved scheme('grpc' or
'grpcs').

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-02 15:55:20 +03:00
Leonard Lyubich
22ce8e13cc [#196] rpc/client: Implement Client.Conn method
Implement `Client.Conn` which returns the connection of the underlying
transport client. The method is going to be used for forwarding the
connection to superior clients.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-31 10:13:00 +03:00
Pavel Karpy
89aede1fb3 [#286] client: Add TLS options
Add `WithTLSConfig` option to client.
If it is not nil then client will
try to open secured connection.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-05-24 16:56:59 +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
30c6ca0714 [#263] Implement client for exchanging raw Protobuf messages
Implement generic `Client` that can communicate with the remote server via
protobuf `Message`'s. The client can uniformly execute any protobuf RPC
on the remote server using any of the supported transport protocols.
Currently only gRPC protocol is supported.

Additionally implement helpful functions to transmit messages by one of the
flow types: unary, client- or server-side stream.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-03-17 14:03:49 +03:00