2020-09-30 10:52:14 +00:00
|
|
|
package deletesvc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
2021-11-10 07:08:33 +00:00
|
|
|
"github.com/nspcc-dev/neofs-sdk-go/object"
|
2020-09-30 10:52:14 +00:00
|
|
|
)
|
|
|
|
|
2021-11-01 08:35:33 +00:00
|
|
|
// TombstoneAddressWriter is an interface of tombstone address setter.
|
|
|
|
type TombstoneAddressWriter interface {
|
|
|
|
SetAddress(*object.Address)
|
|
|
|
}
|
|
|
|
|
2020-12-11 08:04:04 +00:00
|
|
|
// Prm groups parameters of Delete service call.
|
2020-09-30 10:52:14 +00:00
|
|
|
type Prm struct {
|
|
|
|
common *util.CommonPrm
|
|
|
|
|
2021-11-01 08:35:33 +00:00
|
|
|
addr *object.Address
|
|
|
|
|
|
|
|
tombAddrWriter TombstoneAddressWriter
|
2020-09-30 10:52:14 +00:00
|
|
|
}
|
|
|
|
|
2020-12-11 08:04:04 +00:00
|
|
|
// SetCommonParameters sets common parameters of the operation.
|
|
|
|
func (p *Prm) SetCommonParameters(common *util.CommonPrm) {
|
|
|
|
p.common = common
|
2020-09-30 10:52:14 +00:00
|
|
|
}
|
2021-11-01 08:35:33 +00:00
|
|
|
|
|
|
|
// WithAddress sets address of the object to be removed.
|
|
|
|
func (p *Prm) WithAddress(addr *object.Address) {
|
|
|
|
p.addr = addr
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithTombstoneAddressTarget sets tombstone address destination.
|
|
|
|
func (p *Prm) WithTombstoneAddressTarget(w TombstoneAddressWriter) {
|
|
|
|
p.tombAddrWriter = w
|
|
|
|
}
|