Airat Arifullin
9b13a18aac
* Update version within go.mod; * Fix deprecated frostfs-api-go/v2 package and use frostfs-sdk-go/api instead. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
32 lines
792 B
Go
32 lines
792 B
Go
package object
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object"
|
|
objectGRPC "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object/grpc"
|
|
)
|
|
|
|
type getStreamerV2 struct {
|
|
objectGRPC.ObjectService_GetServer
|
|
}
|
|
|
|
func (s *getStreamerV2) Send(resp *object.GetResponse) error {
|
|
return s.ObjectService_GetServer.Send(
|
|
resp.ToGRPCMessage().(*objectGRPC.GetResponse),
|
|
)
|
|
}
|
|
|
|
// Get converts gRPC GetRequest message and server-side stream and overtakes its data
|
|
// to gRPC stream.
|
|
func (s *Server) Get(req *objectGRPC.GetRequest, gStream objectGRPC.ObjectService_GetServer) error {
|
|
getReq := new(object.GetRequest)
|
|
if err := getReq.FromGRPCMessage(req); err != nil {
|
|
return err
|
|
}
|
|
|
|
return s.srv.Get(
|
|
getReq,
|
|
&getStreamerV2{
|
|
ObjectService_GetServer: gStream,
|
|
},
|
|
)
|
|
}
|