gRPC client load-balancing API is ugly as f:
1. It is configured by pre-registering a balancer and the providing JSON
configuration.
2. It doesn't allow different credentials for different endpoints
(consider using "insecure" localhost and external endpoint).
3. To support frostfs usecase we also need to implement a resolver,
which has its own difficulties.
4. https://github.com/grpc/grpc-go/issues/239#issuecomment-264548415
Using interface in place of grpc.ClientConn allows us to provide custom
implentation for it (load-balancing, circuit breaker etc.).
Refs TrueCloudLab/frostfs-node#1268
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
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>
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>
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>