2020-09-28 13:22:13 +00:00
|
|
|
package rangehashsvc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/pkg"
|
|
|
|
"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-28 13:22:13 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Prm struct {
|
2020-09-29 15:05:22 +00:00
|
|
|
common *util.CommonPrm
|
2020-09-28 13:22:13 +00:00
|
|
|
|
|
|
|
addr *object.Address
|
|
|
|
|
|
|
|
typ pkg.ChecksumType
|
|
|
|
|
|
|
|
rngs []*object.Range
|
|
|
|
|
|
|
|
salt []byte
|
|
|
|
}
|
|
|
|
|
2020-09-29 15:05:22 +00:00
|
|
|
func (p *Prm) WithCommonPrm(v *util.CommonPrm) *Prm {
|
2020-09-28 13:22:13 +00:00
|
|
|
if p != nil {
|
2020-09-29 15:05:22 +00:00
|
|
|
p.common = v
|
2020-09-28 13:22:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return p
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Prm) WithAddress(v *object.Address) *Prm {
|
|
|
|
if p != nil {
|
|
|
|
p.addr = v
|
|
|
|
}
|
|
|
|
|
|
|
|
return p
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Prm) WithChecksumType(typ pkg.ChecksumType) *Prm {
|
|
|
|
if p != nil {
|
|
|
|
p.typ = typ
|
|
|
|
}
|
|
|
|
|
|
|
|
return p
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Prm) FromRanges(v ...*object.Range) *Prm {
|
|
|
|
if p != nil {
|
|
|
|
p.rngs = v
|
|
|
|
}
|
|
|
|
|
|
|
|
return p
|
|
|
|
}
|