2020-09-21 14:31:31 +00:00
|
|
|
package putsvc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
2020-09-29 15:05:22 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
|
2020-09-21 14:31:31 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/object_manager/placement"
|
|
|
|
)
|
|
|
|
|
|
|
|
type PutInitPrm struct {
|
2020-09-29 15:05:22 +00:00
|
|
|
common *util.CommonPrm
|
2020-09-21 14:31:31 +00:00
|
|
|
|
|
|
|
hdr *object.RawObject
|
|
|
|
|
|
|
|
traverseOpts []placement.Option
|
|
|
|
}
|
|
|
|
|
|
|
|
type PutChunkPrm struct {
|
|
|
|
chunk []byte
|
|
|
|
}
|
|
|
|
|
2020-09-29 15:05:22 +00:00
|
|
|
func (p *PutInitPrm) WithCommonPrm(v *util.CommonPrm) *PutInitPrm {
|
2020-09-21 14:31:31 +00:00
|
|
|
if p != nil {
|
2020-09-29 15:05:22 +00:00
|
|
|
p.common = v
|
2020-09-21 14:31:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return p
|
|
|
|
}
|
|
|
|
|
2020-09-29 15:05:22 +00:00
|
|
|
func (p *PutInitPrm) WithObject(v *object.RawObject) *PutInitPrm {
|
2020-09-21 14:31:31 +00:00
|
|
|
if p != nil {
|
2020-09-29 15:05:22 +00:00
|
|
|
p.hdr = v
|
2020-09-21 14:31:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return p
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *PutChunkPrm) WithChunk(v []byte) *PutChunkPrm {
|
|
|
|
if p != nil {
|
|
|
|
p.chunk = v
|
|
|
|
}
|
|
|
|
|
|
|
|
return p
|
|
|
|
}
|