ByStoragePrefixDistribution looks up repository by storage, prefix & distribution
(storage, prefix, distribution string)
| 1449 | |
| 1450 | // ByStoragePrefixDistribution looks up repository by storage, prefix & distribution |
| 1451 | func (collection *PublishedRepoCollection) ByStoragePrefixDistribution(storage, prefix, distribution string) (*PublishedRepo, error) { |
| 1452 | collection.loadList() |
| 1453 | |
| 1454 | for _, r := range collection.list { |
| 1455 | if r.Prefix == prefix && r.Distribution == distribution && r.Storage == storage { |
| 1456 | return r, nil |
| 1457 | } |
| 1458 | } |
| 1459 | if storage != "" { |
| 1460 | storage += ":" |
| 1461 | } |
| 1462 | return nil, fmt.Errorf("published repo with storage:prefix/distribution %s%s/%s not found", storage, prefix, distribution) |
| 1463 | } |
| 1464 | |
| 1465 | // ByUUID looks up repository by uuid |
| 1466 | func (collection *PublishedRepoCollection) ByUUID(uuid string) (*PublishedRepo, error) { |