frostfs-node/pkg/services/object/get/v2/util.go
Leonard Lyubich 39c17253be [] services/object: Combine common service parameters
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-02 11:25:36 +03:00

23 lines
605 B
Go

package getsvc
import (
"github.com/nspcc-dev/neofs-api-go/pkg/object"
objectV2 "github.com/nspcc-dev/neofs-api-go/v2/object"
getsvc "github.com/nspcc-dev/neofs-node/pkg/services/object/get"
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
)
func toPrm(req *objectV2.GetRequest) *getsvc.Prm {
return new(getsvc.Prm).
WithAddress(
object.NewAddressFromV2(req.GetBody().GetAddress()),
).
WithCommonPrm(util.CommonPrmFromV2(req))
}
func fromResponse(res *getsvc.Streamer) objectV2.GetObjectStreamer {
return &streamer{
stream: res,
body: new(objectV2.GetResponseBody),
}
}