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

Method GetTemplate

cache/template_cache.go:32–42  ·  view source on GitHub ↗
(id uint)

Source from the content-addressed store, hash-verified

30}
31
32func (t *TemplateCache) GetTemplate(id uint) (params.Template, bool) {
33 t.mux.Lock()
34 defer t.mux.Unlock()
35
36 tpl, ok := t.cache[id]
37 if !ok {
38 return params.Template{}, false
39 }
40
41 return tpl, true
42}
43
44func (t *TemplateCache) ListTemplates(osType *commonParams.OSType, forgeType *params.EndpointType) []params.Template {
45 ret := []params.Template{}

Callers

nothing calls this directly

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected