MCPcopy
hub / github.com/avelino/awesome-go / writeCachedMeta

Function writeCachedMeta

main.go:589–601  ·  view source on GitHub ↗
(p *Project, meta *RepoMeta)

Source from the content-addressed store, hash-verified

587}
588
589func writeCachedMeta(p *Project, meta *RepoMeta) error {
590 path := cacheFilePath(p)
591 if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
592 return err
593 }
594
595 data, err := json.MarshalIndent(meta, "", " ")
596 if err != nil {
597 return err
598 }
599
600 return os.WriteFile(path, data, 0644)
601}
602
603func fetchGitHubMeta(client *http.Client, owner, repo, token string) *RepoMeta {
604 apiURL := fmt.Sprintf("https://api.github.com/repos/%s/%s", owner, repo)

Callers 1

fetchProjectMetaFunction · 0.85

Calls 1

cacheFilePathFunction · 0.85

Tested by

no test coverage detected