mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-10-20 10:57:09 +00:00
RemoteRepo by UUID lookup.
This commit is contained in:
1 parent
c38592dc02
commit
8cb25c037b
2 files changed
+21
No files matched your search
Vendored
+10
@@ -320,6 +320,16 @@ func (collection *RemoteRepoCollection) ByName(name string) (*RemoteRepo, error)
|
||||
return nil, fmt.Errorf("mirror with name %s not found", name)
|
||||
}
|
||||
|
||||
// ByUUID looks up repository by uuid
|
||||
func (collection *RemoteRepoCollection) ByUUID(uuid string) (*RemoteRepo, error) {
|
||||
for _, r := range collection.list {
|
||||
if r.UUID == uuid {
|
||||
return r, nil
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("mirror with uuid %s not found", uuid)
|
||||
}
|
||||
|
||||
// ForEach runs method for each repository
|
||||
func (collection *RemoteRepoCollection) ForEach(handler func(*RemoteRepo)) {
|
||||
for _, r := range collection.list {
|
||||
|
||||
Reference in new issue
Block a user