frostfs-node/pkg/services/object/put/prm.go
Leonard Lyubich 57f8d3745d [#33] service/object: Implement object Put distributed service
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-02 11:25:35 +03:00

53 lines
796 B
Go

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_manager/placement"
)
type PutInitPrm struct {
local bool
hdr *object.RawObject
token *token.SessionToken
traverseOpts []placement.Option
}
type PutChunkPrm struct {
chunk []byte
}
func (p *PutInitPrm) WithObject(v *object.RawObject) *PutInitPrm {
if p != nil {
p.hdr = v
}
return p
}
func (p *PutInitPrm) WithSession(v *token.SessionToken) *PutInitPrm {
if p != nil {
p.token = v
}
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
}
return p
}