2021-06-09 15:37:03 +00:00
|
|
|
package control
|
|
|
|
|
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
|
2021-06-09 15:37:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|