frostfs-node/pkg/services/control/ir/convert.go
Alejandro Lopez ff25521204
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful
[#270] Add IR epoch tick control call
Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
2023-04-28 07:57:00 +00:00

34 lines
595 B
Go

package control
import (
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
)
type requestWrapper struct {
message.Message
m grpc.Message
}
func (w *requestWrapper) ToGRPCMessage() grpc.Message {
return w.m
}
type responseWrapper[M grpc.Message] struct {
m M
}
func (w *responseWrapper[M]) ToGRPCMessage() grpc.Message {
return w.m
}
func (w *responseWrapper[M]) FromGRPCMessage(m grpc.Message) error {
var ok bool
w.m, ok = m.(M)
if !ok {
return message.NewUnexpectedMessageType(m, w.m)
}
return nil
}