frostfs-node/pkg/services/control/ir/convert.go
Leonard Lyubich 7f5fb130c0 [#961] *: Support NeoFS API status returns
Upgrade NeoFS API Go library to version with status returns. Make all API
clients to pull out and return errors from failed statuses. Make signature
service to respond with status if client version supports it.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 09:26:40 +03:00

34 lines
622 B
Go

package control
import (
"github.com/nspcc-dev/neofs-api-go/v2/rpc/grpc"
"github.com/nspcc-dev/neofs-api-go/v2/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
}