CheckDuplicate verifies that there's no published repo with the same name
(repo *PublishedRepo)
| 1343 | |
| 1344 | // CheckDuplicate verifies that there's no published repo with the same name |
| 1345 | func (collection *PublishedRepoCollection) CheckDuplicate(repo *PublishedRepo) *PublishedRepo { |
| 1346 | collection.loadList() |
| 1347 | |
| 1348 | for _, r := range collection.list { |
| 1349 | if r.Prefix == repo.Prefix && r.Distribution == repo.Distribution && r.Storage == repo.Storage { |
| 1350 | return r |
| 1351 | } |
| 1352 | } |
| 1353 | |
| 1354 | return nil |
| 1355 | } |
| 1356 | |
| 1357 | // Update stores updated information about repo in DB |
| 1358 | func (collection *PublishedRepoCollection) Update(repo *PublishedRepo) error { |