MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/scion / save

Method save

pkg/agent/github_resolution_cache.go:138–149  ·  view source on GitHub ↗

save persists the given entries snapshot to disk atomically. Best-effort.

(entries map[string]*resolutionCacheEntry)

Source from the content-addressed store, hash-verified

136 if !strings.Contains(k, "#") {
137 snapshot[k] = v
138 }
139 }
140 c.mu.Unlock()
141
142 c.save(snapshot)
143}
144
145// load reads the cache from disk. Best-effort: errors are silently ignored.
146func (c *GitHubResolutionCache) load() {
147 data, err := os.ReadFile(c.filePath)
148 if err != nil {
149 return
150 }
151 var f resolutionCacheFile
152 if err := json.Unmarshal(data, &f); err != nil {

Callers 8

PutMethod · 0.95
drawMethod · 0.80
drawAgentMethod · 0.80
drawMethod · 0.80
drawMethod · 0.80
drawNodeMethod · 0.80
drawBroadcastMethod · 0.80
drawDirectMessageMethod · 0.80

Calls 1

RenameMethod · 0.80

Tested by

no test coverage detected