forked from TrueCloudLab/frostfs-node
[#57] services/object: Combine common service parameters
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
8cddbe58a6
commit
39c17253be
24 changed files with 109 additions and 61 deletions
|
@ -3,11 +3,12 @@ package putsvc
|
|||
import (
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/token"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object_manager/placement"
|
||||
)
|
||||
|
||||
type PutInitPrm struct {
|
||||
local bool
|
||||
common *util.CommonPrm
|
||||
|
||||
hdr *object.RawObject
|
||||
|
||||
|
@ -20,6 +21,14 @@ type PutChunkPrm struct {
|
|||
chunk []byte
|
||||
}
|
||||
|
||||
func (p *PutInitPrm) WithCommonPrm(v *util.CommonPrm) *PutInitPrm {
|
||||
if p != nil {
|
||||
p.common = v
|
||||
}
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *PutInitPrm) WithObject(v *object.RawObject) *PutInitPrm {
|
||||
if p != nil {
|
||||
p.hdr = v
|
||||
|
@ -36,14 +45,6 @@ func (p *PutInitPrm) WithSession(v *token.SessionToken) *PutInitPrm {
|
|||
return p
|
||||
}
|
||||
|
||||
func (p *PutInitPrm) OnlyLocal(v bool) *PutInitPrm {
|
||||
if p != nil {
|
||||
p.local = v
|
||||
}
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *PutChunkPrm) WithChunk(v []byte) *PutChunkPrm {
|
||||
if p != nil {
|
||||
p.chunk = v
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue