2023-02-28 10:01:18 +00:00
|
|
|
package signature
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session"
|
|
|
|
)
|
|
|
|
|
2023-05-03 11:04:03 +00:00
|
|
|
// nolint:funlen
|
2023-05-15 14:25:04 +00:00
|
|
|
func serviceMessageBody(req any) stableMarshaler {
|
2023-02-28 10:01:18 +00:00
|
|
|
switch v := req.(type) {
|
|
|
|
default:
|
|
|
|
panic(fmt.Sprintf("unsupported session message %T", req))
|
|
|
|
|
|
|
|
/* Accounting */
|
|
|
|
case *accounting.BalanceRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *accounting.BalanceResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
|
|
|
|
/* Session */
|
|
|
|
case *session.CreateRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *session.CreateResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
|
|
|
|
/* Container */
|
|
|
|
case *container.PutRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.PutResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.DeleteRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.DeleteResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.GetRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.GetResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.ListRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.ListResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.SetExtendedACLRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.SetExtendedACLResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.GetExtendedACLRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.GetExtendedACLResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.AnnounceUsedSpaceRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *container.AnnounceUsedSpaceResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
|
|
|
|
/* Object */
|
|
|
|
case *object.PutRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.PutResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.GetRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.GetResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.HeadRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.HeadResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.SearchRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.SearchResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.DeleteRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.DeleteResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.GetRangeRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.GetRangeResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.GetRangeHashRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *object.GetRangeHashResponse:
|
|
|
|
return v.GetBody()
|
2023-06-30 12:00:51 +00:00
|
|
|
case *object.PutSingleRequest:
|
|
|
|
return v.GetBody()
|
2023-02-28 10:01:18 +00:00
|
|
|
|
|
|
|
/* Netmap */
|
|
|
|
case *netmap.LocalNodeInfoRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *netmap.LocalNodeInfoResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *netmap.NetworkInfoRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *netmap.NetworkInfoResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
case *netmap.SnapshotRequest:
|
|
|
|
return v.GetBody()
|
|
|
|
case *netmap.SnapshotResponse:
|
|
|
|
return v.GetBody()
|
|
|
|
}
|
|
|
|
}
|