frostfs-node/pkg/services/control/ir/convert.go
Airat Arifullin 9b13a18aac [#1479] go.mod: Bump frostfs-sdk-go version
* Update version within go.mod;
* Fix deprecated frostfs-api-go/v2 package and use frostfs-sdk-go/api
  instead.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-11-08 10:43:19 +03:00

34 lines
597 B
Go

package control
import (
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/rpc/grpc"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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
}