frostfs-node/pkg/services/control/ir/convert.go
Dmitrii Stepanov 188ab89bc9 [#733] cli: Add control ir remove-container
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-10-20 12:55:13 +03:00

53 lines
1,021 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 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
}
type removeContainerResponseWrapper struct {
m *RemoveContainerResponse
}
func (w *removeContainerResponseWrapper) ToGRPCMessage() grpc.Message {
return w.m
}
func (w *removeContainerResponseWrapper) FromGRPCMessage(m grpc.Message) error {
var ok bool
w.m, ok = m.(*RemoveContainerResponse)
if !ok {
return message.NewUnexpectedMessageType(m, w.m)
}
return nil
}