[#1786] engine: Unify parameter setters

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-09-14 17:36:37 +03:00 committed by fyrchik
parent b064fb24d8
commit 5321f8ef9c
7 changed files with 16 additions and 42 deletions

View file

@ -27,9 +27,7 @@ type RngRes struct {
//
// Option is required.
func (p *RngPrm) WithAddress(addr oid.Address) {
if p != nil {
p.addr = addr
}
p.addr = addr
}
// WithPayloadRange is a GetRange option to set range of requested payload data.
@ -37,9 +35,7 @@ func (p *RngPrm) WithAddress(addr oid.Address) {
// Missing an option or calling with zero length is equivalent
// to getting the full payload range.
func (p *RngPrm) WithPayloadRange(rng *objectSDK.Range) {
if p != nil {
p.off, p.ln = rng.GetOffset(), rng.GetLength()
}
p.off, p.ln = rng.GetOffset(), rng.GetLength()
}
// Object returns the requested object part.