2020-09-22 06:51:47 +00:00
|
|
|
package searchsvc
|
|
|
|
|
|
|
|
import (
|
2020-12-10 12:26:40 +00:00
|
|
|
"github.com/nspcc-dev/neofs-api-go/pkg/client"
|
|
|
|
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
2020-09-29 15:05:22 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
2020-09-22 06:51:47 +00:00
|
|
|
)
|
|
|
|
|
2020-12-10 12:26:40 +00:00
|
|
|
// Prm groups parameters of Get service call.
|
2020-09-22 06:51:47 +00:00
|
|
|
type Prm struct {
|
2020-12-10 12:26:40 +00:00
|
|
|
writer IDListWriter
|
2020-09-22 06:51:47 +00:00
|
|
|
|
2020-12-10 12:26:40 +00:00
|
|
|
common *util.CommonPrm
|
2020-09-22 06:51:47 +00:00
|
|
|
|
2020-12-10 12:26:40 +00:00
|
|
|
client.SearchObjectParams
|
2021-04-29 08:54:40 +00:00
|
|
|
|
|
|
|
forwarder RequestForwarder
|
2020-12-10 12:26:40 +00:00
|
|
|
}
|
2020-09-22 06:51:47 +00:00
|
|
|
|
2020-12-10 12:26:40 +00:00
|
|
|
// IDListWriter is an interface of target component
|
|
|
|
// to write list of object identifiers.
|
|
|
|
type IDListWriter interface {
|
|
|
|
WriteIDs([]*objectSDK.ID) error
|
2020-09-22 06:51:47 +00:00
|
|
|
}
|
|
|
|
|
2021-04-29 08:54:40 +00:00
|
|
|
// RequestForwarder is a callback for forwarding of the
|
|
|
|
// original Search requests.
|
|
|
|
type RequestForwarder func(client.Client) ([]*objectSDK.ID, error)
|
|
|
|
|
2020-12-10 12:26:40 +00:00
|
|
|
// SetCommonParameters sets common parameters of the operation.
|
|
|
|
func (p *Prm) SetCommonParameters(common *util.CommonPrm) {
|
|
|
|
p.common = common
|
|
|
|
}
|
2020-09-22 06:51:47 +00:00
|
|
|
|
2020-12-10 12:26:40 +00:00
|
|
|
// SetWriter sets target component to write list of object identifiers.
|
|
|
|
func (p *Prm) SetWriter(w IDListWriter) {
|
|
|
|
p.writer = w
|
2020-09-22 06:51:47 +00:00
|
|
|
}
|
2021-04-29 08:54:40 +00:00
|
|
|
|
|
|
|
// SetRequestForwarder sets callback for forwarding
|
|
|
|
// of the original request.
|
|
|
|
func (p *Prm) SetRequestForwarder(f RequestForwarder) {
|
|
|
|
p.forwarder = f
|
|
|
|
}
|