[#243] services/object: Share common parameters across services

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-12-11 14:59:16 +03:00 committed by Alex Vanin
parent a01262d8bd
commit fb50362dcc
12 changed files with 89 additions and 163 deletions

View file

@ -1,7 +1,6 @@
package getsvc
import (
"crypto/ecdsa"
"hash"
"github.com/nspcc-dev/neofs-api-go/pkg/client"
@ -39,11 +38,6 @@ type HeadPrm struct {
type commonPrm struct {
objWriter ObjectWriter
// TODO: replace key and callOpts to CommonPrm
key *ecdsa.PrivateKey
callOpts []client.CallOption
common *util.CommonPrm
client.GetObjectParams
@ -72,16 +66,6 @@ func (p *Prm) SetObjectWriter(w ObjectWriter) {
p.objWriter = w
}
// SetPrivateKey sets private key to use during execution.
func (p *commonPrm) SetPrivateKey(key *ecdsa.PrivateKey) {
p.key = key
}
// SetRemoteCallOptions sets call options remote remote client calls.
func (p *commonPrm) SetRemoteCallOptions(opts ...client.CallOption) {
p.callOpts = opts
}
// SetChunkWriter sets target component to write the object payload range.
func (p *RangePrm) SetChunkWriter(w ChunkWriter) {
p.objWriter = &partWriter{