ForEach runs method for each repository
(handler func(*LocalRepo) error)
| 220 | |
| 221 | // ForEach runs method for each repository |
| 222 | func (collection *LocalRepoCollection) ForEach(handler func(*LocalRepo) error) error { |
| 223 | return collection.db.ProcessByPrefix([]byte("L"), func(_, blob []byte) error { |
| 224 | r := &LocalRepo{} |
| 225 | if err := r.Decode(blob); err != nil { |
| 226 | log.Printf("Error decoding repo: %s\n", err) |
| 227 | return nil |
| 228 | } |
| 229 | |
| 230 | return handler(r) |
| 231 | }) |
| 232 | } |
| 233 | |
| 234 | // Len returns number of remote repos |
| 235 | func (collection *LocalRepoCollection) Len() int { |
nothing calls this directly
no test coverage detected