frostfs-node/pkg/services/object/search/v2/streamer.go
Alex Vanin 20de74a505 Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 16:38:26 +03:00

29 lines
640 B
Go

package searchsvc
import (
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs"
objectSvc "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/object"
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
)
type streamWriter struct {
stream objectSvc.SearchStream
}
func (s *streamWriter) WriteIDs(ids []oid.ID) error {
r := new(object.SearchResponse)
body := new(object.SearchResponseBody)
r.SetBody(body)
idsV2 := make([]refs.ObjectID, len(ids))
for i := range ids {
ids[i].WriteToV2(&idsV2[i])
}
body.SetIDList(idsV2)
return s.stream.Send(r)
}