---------- disk cache -------------------------------------------------------
(url string, kind entities.Kind, cache camconfig.CacheConfig)
| 287 | // ---------- disk cache ------------------------------------------------------- |
| 288 | |
| 289 | func 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 | |
| 297 | func loadFromCache(url string, kind entities.Kind, cache camconfig.CacheConfig) (map[string]RepoEntry, error) { |
| 298 | path := cacheFilePath(url, kind, cache) |
no outgoing calls
no test coverage detected