forked from TrueCloudLab/frostfs-node
[#52] object/range: Attach received object header to result
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
0490107165
commit
abf9ad3573
3 changed files with 30 additions and 9 deletions
|
@ -55,7 +55,7 @@ func NewService(opts ...Option) *Service {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *Service) GetRange(ctx context.Context, prm *Prm) (Streamer, error) {
|
||||
func (s *Service) GetRange(ctx context.Context, prm *Prm) (*Result, error) {
|
||||
headResult, err := s.headSvc.Head(ctx, new(headsvc.Prm).
|
||||
WithAddress(prm.addr).
|
||||
OnlyLocal(prm.local),
|
||||
|
@ -83,12 +83,15 @@ func (s *Service) GetRange(ctx context.Context, prm *Prm) (Streamer, error) {
|
|||
return nil, errors.Wrapf(err, "(%T) could not fill range traverser", s)
|
||||
}
|
||||
|
||||
return &streamer{
|
||||
cfg: s.cfg,
|
||||
once: new(sync.Once),
|
||||
ctx: ctx,
|
||||
prm: prm,
|
||||
rangeTraverser: rngTraverser,
|
||||
return &Result{
|
||||
head: origin,
|
||||
stream: &streamer{
|
||||
cfg: s.cfg,
|
||||
once: new(sync.Once),
|
||||
ctx: ctx,
|
||||
prm: prm,
|
||||
rangeTraverser: rngTraverser,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue