MCPcopy Create free account
hub / github.com/cloudbase/garm / GetAllInstances

Method GetAllInstances

cache/instance_cache.go:61–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61func (i *InstanceCache) GetAllInstances() []params.Instance {
62 i.mux.Lock()
63 defer i.mux.Unlock()
64
65 instances := make([]params.Instance, 0, len(i.cache))
66 for _, instance := range i.cache {
67 instances = append(instances, instance)
68 }
69 sortByCreationDate(instances)
70 return instances
71}
72
73func (i *InstanceCache) GetEntityForInstance(name string) (params.ForgeEntity, bool) {
74 instance, ok := i.GetInstance(name)

Callers 2

GetEntityInstancesMethod · 0.95
GetAllInstancesCacheFunction · 0.80

Calls 3

sortByCreationDateFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected