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 }