Function
newStreamHandler
(index string, req *bleve.SearchRequest,
outStream pb.SearchService_SearchServer)
Source from the content-addressed store, hash-verified
| 46 | } |
| 47 | |
| 48 | func newStreamHandler(index string, req *bleve.SearchRequest, |
| 49 | outStream pb.SearchService_SearchServer) *streamer { |
| 50 | rv := &streamer{ |
| 51 | index: index, |
| 52 | curSize: int(req.Size), |
| 53 | curSkip: int(req.From), |
| 54 | stream: outStream, |
| 55 | req: req, |
| 56 | } |
| 57 | if req.Size > 0 { |
| 58 | rv.sizeSet = true |
| 59 | } |
| 60 | if req.From > 0 { |
| 61 | rv.skipSet = true |
| 62 | } |
| 63 | return rv |
| 64 | } |
| 65 | |
| 66 | func (s *streamer) write(b []byte, offsets []uint64, hitsCount int) error { |
| 67 | s.m.Lock() |
Tested by
no test coverage detected