frostfs-node/pkg/services/object/rangehash/prm.go
Leonard Lyubich 0a51263e72 [#53] services/object: Implement GetRangeHash service
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-02 11:25:36 +03:00

50 lines
623 B
Go

package rangehashsvc
import (
"github.com/nspcc-dev/neofs-api-go/pkg"
"github.com/nspcc-dev/neofs-api-go/pkg/object"
)
type Prm struct {
local bool
addr *object.Address
typ pkg.ChecksumType
rngs []*object.Range
salt []byte
}
func (p *Prm) OnlyLocal(v bool) *Prm {
if p != nil {
p.local = v
}
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
}