[#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

@ -25,12 +25,10 @@ func (w *headSvcWrapper) headAddress(exec *execCtx, addr *objectSDK.Address) (*o
wr := getsvc.NewSimpleObjectWriter()
p := getsvc.HeadPrm{}
p.SetPrivateKey(exec.key())
p.SetCommonParameters(exec.commonParameters())
p.SetHeaderWriter(wr)
p.WithRawFlag(true)
p.WithAddress(addr)
p.SetRemoteCallOptions(exec.callOptions()...)
err := (*getsvc.Service)(w).Head(exec.context(), p)
if err != nil {
@ -86,10 +84,8 @@ func (w *searchSvcWrapper) splitMembers(exec *execCtx) ([]*objectSDK.ID, error)
p := searchsvc.Prm{}
p.SetWriter(wr)
p.SetCommonParameters(exec.commonParameters())
p.SetPrivateKey(exec.key())
p.WithContainerID(exec.containerID())
p.WithSearchFilters(fs)
p.SetRemoteCallOptions(exec.callOptions()...)
err := (*searchsvc.Service)(w).Search(exec.context(), p)
if err != nil {