2020-09-30 10:52:14 +00:00
|
|
|
package deletesvc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
2022-01-26 12:11:13 +00:00
|
|
|
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
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 {
|
2022-01-26 12:11:13 +00:00
|
|
|
SetAddress(*addressSDK.Address)
|
2021-11-01 08:35:33 +00:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
2022-01-26 12:11:13 +00:00
|
|
|
addr *addressSDK.Address
|
2021-11-01 08:35:33 +00:00
|
|
|
|
|
|
|
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.
|
2022-01-26 12:11:13 +00:00
|
|
|
func (p *Prm) WithAddress(addr *addressSDK.Address) {
|
2021-11-01 08:35:33 +00:00
|
|
|
p.addr = addr
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithTombstoneAddressTarget sets tombstone address destination.
|
|
|
|
func (p *Prm) WithTombstoneAddressTarget(w TombstoneAddressWriter) {
|
|
|
|
p.tombAddrWriter = w
|
|
|
|
}
|