forked from TrueCloudLab/frostfs-node
93803b1a90
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>
34 lines
616 B
Go
34 lines
616 B
Go
package control
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-api-go/rpc/grpc"
|
|
"github.com/nspcc-dev/neofs-api-go/rpc/message"
|
|
)
|
|
|
|
type requestWrapper struct {
|
|
message.Message
|
|
m grpc.Message
|
|
}
|
|
|
|
func (w *requestWrapper) ToGRPCMessage() grpc.Message {
|
|
return w.m
|
|
}
|
|
|
|
type healthCheckResponseWrapper struct {
|
|
m *HealthCheckResponse
|
|
}
|
|
|
|
func (w *healthCheckResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
return w.m
|
|
}
|
|
|
|
func (w *healthCheckResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
var ok bool
|
|
|
|
w.m, ok = m.(*HealthCheckResponse)
|
|
if !ok {
|
|
return message.NewUnexpectedMessageType(m, w.m)
|
|
}
|
|
|
|
return nil
|
|
}
|