MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / cacheFilePath

Function cacheFilePath

internal/repoconfig/repoconfig.go:289–295  ·  view source on GitHub ↗

---------- disk cache -------------------------------------------------------

(url string, kind entities.Kind, cache camconfig.CacheConfig)

Source from the content-addressed store, hash-verified

287// ---------- disk cache -------------------------------------------------------
288
289func cacheFilePath(url string, kind entities.Kind, cache camconfig.CacheConfig) string {
290 safe := strings.ReplaceAll(url, "https://", "")
291 safe = strings.ReplaceAll(safe, "http://", "")
292 safe = strings.ReplaceAll(safe, "/", "_")
293 safe = strings.ReplaceAll(safe, ":", "_")
294 return filepath.Join(cache.Directory, fmt.Sprintf("%s_%s.json", kind, safe))
295}
296
297func loadFromCache(url string, kind entities.Kind, cache camconfig.CacheConfig) (map[string]RepoEntry, error) {
298 path := cacheFilePath(url, kind, cache)

Callers 2

loadFromCacheFunction · 0.85
saveToCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected