2020-09-26 07:54:03 +00:00
|
|
|
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"
|
2020-09-29 15:05:22 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
2020-09-26 07:54:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func toPrm(req *objectV2.GetRequest) *getsvc.Prm {
|
|
|
|
return new(getsvc.Prm).
|
|
|
|
WithAddress(
|
|
|
|
object.NewAddressFromV2(req.GetBody().GetAddress()),
|
|
|
|
).
|
2020-09-29 15:05:22 +00:00
|
|
|
WithCommonPrm(util.CommonPrmFromV2(req))
|
2020-09-26 07:54:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func fromResponse(res *getsvc.Streamer) objectV2.GetObjectStreamer {
|
|
|
|
return &streamer{
|
|
|
|
stream: res,
|
|
|
|
body: new(objectV2.GetResponseBody),
|
|
|
|
}
|
|
|
|
}
|