ForEach runs method for each repository
(handler func(*PublishedRepo) error)
| 1520 | |
| 1521 | // ForEach runs method for each repository |
| 1522 | func (collection *PublishedRepoCollection) ForEach(handler func(*PublishedRepo) error) error { |
| 1523 | return collection.db.ProcessByPrefix([]byte("U"), func(_, blob []byte) error { |
| 1524 | r := &PublishedRepo{} |
| 1525 | if err := r.Decode(blob); err != nil { |
| 1526 | log.Printf("Error decoding published repo: %s\n", err) |
| 1527 | return nil |
| 1528 | } |
| 1529 | |
| 1530 | return handler(r) |
| 1531 | }) |
| 1532 | } |
| 1533 | |
| 1534 | // Len returns number of remote repos |
| 1535 | func (collection *PublishedRepoCollection) Len() int { |
no test coverage detected