2021-03-15 11:04:13 +00:00
|
|
|
package control
|
|
|
|
|
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/grpc"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
|
2021-03-15 11:04:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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 setNetmapStatusResponseWrapper struct {
|
|
|
|
message.Message
|
|
|
|
m *SetNetmapStatusResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *setNetmapStatusResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
|
|
return w.m
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *setNetmapStatusResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
var ok bool
|
|
|
|
|
|
|
|
w.m, ok = m.(*SetNetmapStatusResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, w.m)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type dropObjectsResponseWrapper struct {
|
|
|
|
message.Message
|
|
|
|
m *DropObjectsResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *dropObjectsResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
|
|
return w.m
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *dropObjectsResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
var ok bool
|
|
|
|
|
|
|
|
w.m, ok = m.(*DropObjectsResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, w.m)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
2021-12-17 15:23:46 +00:00
|
|
|
|
2021-12-29 15:12:40 +00:00
|
|
|
type listShardsResponseWrapper struct {
|
2021-12-17 15:23:46 +00:00
|
|
|
m *ListShardsResponse
|
|
|
|
}
|
|
|
|
|
2021-12-29 15:12:40 +00:00
|
|
|
func (w *listShardsResponseWrapper) ToGRPCMessage() grpc.Message {
|
2021-12-17 15:23:46 +00:00
|
|
|
return w.m
|
|
|
|
}
|
|
|
|
|
2021-12-29 15:12:40 +00:00
|
|
|
func (w *listShardsResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
2021-12-17 15:23:46 +00:00
|
|
|
var ok bool
|
|
|
|
|
|
|
|
w.m, ok = m.(*ListShardsResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, w.m)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
2021-12-27 16:12:23 +00:00
|
|
|
|
|
|
|
type setShardModeResponseWrapper struct {
|
|
|
|
m *SetShardModeResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *setShardModeResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
|
|
return w.m
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *setShardModeResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
var ok bool
|
|
|
|
|
|
|
|
w.m, ok = m.(*SetShardModeResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, w.m)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
2022-01-24 10:13:37 +00:00
|
|
|
|
|
|
|
type dumpShardResponseWrapper struct {
|
|
|
|
*DumpShardResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *dumpShardResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
|
|
return w.DumpShardResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *dumpShardResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
r, ok := m.(*DumpShardResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, (*DumpShardResponse)(nil))
|
|
|
|
}
|
|
|
|
|
|
|
|
w.DumpShardResponse = r
|
|
|
|
return nil
|
|
|
|
}
|
2022-01-25 11:54:35 +00:00
|
|
|
|
|
|
|
type restoreShardResponseWrapper struct {
|
|
|
|
*RestoreShardResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *restoreShardResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
|
|
return w.RestoreShardResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *restoreShardResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
r, ok := m.(*RestoreShardResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, (*RestoreShardResponse)(nil))
|
|
|
|
}
|
|
|
|
|
|
|
|
w.RestoreShardResponse = r
|
|
|
|
return nil
|
|
|
|
}
|
2022-05-16 16:31:50 +00:00
|
|
|
|
|
|
|
type synchronizeTreeResponseWrapper struct {
|
|
|
|
*SynchronizeTreeResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *synchronizeTreeResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
|
|
return w.SynchronizeTreeResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *synchronizeTreeResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
r, ok := m.(*SynchronizeTreeResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, (*SynchronizeTreeResponse)(nil))
|
|
|
|
}
|
|
|
|
|
|
|
|
w.SynchronizeTreeResponse = r
|
|
|
|
return nil
|
|
|
|
}
|
2022-09-13 10:28:08 +00:00
|
|
|
|
|
|
|
type evacuateShardResponseWrapper struct {
|
|
|
|
*EvacuateShardResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *evacuateShardResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
|
|
return w.EvacuateShardResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *evacuateShardResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
r, ok := m.(*EvacuateShardResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, (*EvacuateShardResponse)(nil))
|
|
|
|
}
|
|
|
|
|
|
|
|
w.EvacuateShardResponse = r
|
|
|
|
return nil
|
|
|
|
}
|
2022-09-21 10:51:51 +00:00
|
|
|
|
|
|
|
type flushCacheResponseWrapper struct {
|
|
|
|
*FlushCacheResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *flushCacheResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
|
|
return w.FlushCacheResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *flushCacheResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
r, ok := m.(*FlushCacheResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, (*FlushCacheResponse)(nil))
|
|
|
|
}
|
|
|
|
|
|
|
|
w.FlushCacheResponse = r
|
|
|
|
return nil
|
|
|
|
}
|
2023-04-07 11:21:05 +00:00
|
|
|
|
|
|
|
type doctorResponseWrapper struct {
|
|
|
|
*DoctorResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *doctorResponseWrapper) ToGRPCMessage() grpc.Message {
|
|
|
|
return w.DoctorResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *doctorResponseWrapper) FromGRPCMessage(m grpc.Message) error {
|
|
|
|
r, ok := m.(*DoctorResponse)
|
|
|
|
if !ok {
|
|
|
|
return message.NewUnexpectedMessageType(m, (*DoctorResponse)(nil))
|
|
|
|
}
|
|
|
|
|
|
|
|
w.DoctorResponse = r
|
|
|
|
return nil
|
|
|
|
}
|