(done bool)
| 75 | } |
| 76 | |
| 77 | func (p *puller) Pull(done bool) (Batch, error) { |
| 78 | if done { |
| 79 | p.zr = nil |
| 80 | } |
| 81 | if p.zr == nil { |
| 82 | return nil, nil |
| 83 | } |
| 84 | batch := newPullerBatch() |
| 85 | for { |
| 86 | val, err := p.zr.Read() |
| 87 | if err != nil { |
| 88 | return nil, err |
| 89 | } |
| 90 | if val == nil { |
| 91 | p.zr = nil |
| 92 | if len(batch.vals) == 0 { |
| 93 | return nil, nil |
| 94 | } |
| 95 | return batch, nil |
| 96 | } |
| 97 | if batch.appendVal(*val) { |
| 98 | return batch, nil |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | type pullerBatch struct { |
| 104 | buf []byte |
no test coverage detected