Function
sliceToChannel
(ctx context.Context, md []blob.Metadata)
Source from the content-addressed store, hash-verified
| 286 | } |
| 287 | |
| 288 | func sliceToChannel(ctx context.Context, md []blob.Metadata) chan blob.Metadata { |
| 289 | ch := make(chan blob.Metadata) |
| 290 | |
| 291 | go func() { |
| 292 | defer close(ch) |
| 293 | |
| 294 | for _, it := range md { |
| 295 | select { |
| 296 | case ch <- it: |
| 297 | case <-ctx.Done(): |
| 298 | return |
| 299 | } |
| 300 | } |
| 301 | }() |
| 302 | |
| 303 | return ch |
| 304 | } |
| 305 | |
| 306 | func (c *commandRepositorySyncTo) syncCopyBlob(ctx context.Context, m blob.Metadata, src blob.Reader, dst blob.Storage) error { |
| 307 | var data gather.WriteBuffer |
Tested by
no test coverage detected