2021-06-09 15:37:03 +00:00
|
|
|
package control
|
|
|
|
|
|
|
|
import (
|
2021-11-06 11:13:04 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/rpc/client"
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/rpc/common"
|
2021-06-09 15:37:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|