()
| 1307 | } |
| 1308 | |
| 1309 | func (collection *PublishedRepoCollection) loadList() { |
| 1310 | if collection.list != nil { |
| 1311 | return |
| 1312 | } |
| 1313 | |
| 1314 | blobs := collection.db.FetchByPrefix([]byte("U")) |
| 1315 | collection.list = make([]*PublishedRepo, 0, len(blobs)) |
| 1316 | |
| 1317 | for _, blob := range blobs { |
| 1318 | r := &PublishedRepo{} |
| 1319 | if err := r.Decode(blob); err != nil { |
| 1320 | log.Printf("Error decoding published repo: %s\n", err) |
| 1321 | } else { |
| 1322 | collection.list = append(collection.list, r) |
| 1323 | } |
| 1324 | } |
| 1325 | } |
| 1326 | |
| 1327 | // Add appends new repo to collection and saves it |
| 1328 | func (collection *PublishedRepoCollection) Add(repo *PublishedRepo) error { |
no test coverage detected