find package by name
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
8ebf38a472
commit
24a4b65f26
13
machines.go
13
machines.go
|
@ -92,7 +92,7 @@ func (r *Machine) Age(newP *Machine) time.Duration {
|
|||
return t
|
||||
}
|
||||
|
||||
// find a package by name
|
||||
// find a machine by name
|
||||
func (r *Machines) FindByName(name string) *Machine {
|
||||
machinesLock.RLock()
|
||||
defer machinesLock.RUnlock()
|
||||
|
@ -106,6 +106,17 @@ func (r *Machines) FindByName(name string) *Machine {
|
|||
return nil
|
||||
}
|
||||
|
||||
// find a package by name
|
||||
func (m *Machine) FindPackageByName(name string) *Package {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
if m.Packages == nil {
|
||||
return nil
|
||||
}
|
||||
return m.Packages.FindByName(name)
|
||||
}
|
||||
|
||||
func (r *Machines) Len() int {
|
||||
machinesLock.RLock()
|
||||
defer machinesLock.RUnlock()
|
||||
|
|
Loading…
Reference in New Issue