frostfs-node/pkg/services/control/ir/rpc.go
Leonard Lyubich 93803b1a90 [#414] ir: Define Control service
Define `ControlService` for IR similar to the one from storage node. Add
`HealthStatus` RPC which returns health status of the IR application.
Implement getters, setters and methods to sign/verify the messages.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-15 15:21:52 +03:00

34 lines
684 B
Go

package control
import (
"github.com/nspcc-dev/neofs-api-go/rpc/client"
"github.com/nspcc-dev/neofs-api-go/rpc/common"
)
const serviceName = "ircontrol.ControlService"
const (
rpcHealthCheck = "HealthCheck"
)
// HealthCheck executes ControlService.HealthCheck RPC.
func HealthCheck(
cli *client.Client,
req *HealthCheckRequest,
opts ...client.CallOption,
) (*HealthCheckResponse, error) {
wResp := &healthCheckResponseWrapper{
m: new(HealthCheckResponse),
}
wReq := &requestWrapper{
m: req,
}
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcHealthCheck), wReq, wResp, opts...)
if err != nil {
return nil, err
}
return wResp.m, nil
}