MCPcopy
hub / github.com/jetify-com/devbox / GetOutputsWithCache

Method GetOutputsWithCache

internal/devpkg/package.go:714–740  ·  view source on GitHub ↗

GetOutputsWithCache return outputs and their cache URIs if the package is in the binary cache. n+1 WARNING: This will make an http request if FillNarInfoCache is not called before. Grep note: this is used in flake template

()

Source from the content-addressed store, hash-verified

712// n+1 WARNING: This will make an http request if FillNarInfoCache is not called before.
713// Grep note: this is used in flake template
714func (p *Package) GetOutputsWithCache() ([]Output, error) {
715 defer debug.FunctionTimer().End()
716
717 names, err := p.GetOutputNames()
718 if err != nil || len(names) == 0 {
719 return nil, err
720 }
721
722 isEligibleForBinaryCache, err := p.isEligibleForBinaryCache()
723 if err != nil {
724 return nil, err
725 }
726
727 outputs := []Output{}
728 for _, name := range names {
729 output := Output{Name: name}
730 if isEligibleForBinaryCache {
731 status, err := p.fetchNarInfoStatusOnce(name)
732 if err != nil {
733 return nil, err
734 }
735 output.CacheURI = status[name]
736 }
737 outputs = append(outputs, output)
738 }
739 return outputs, nil
740}
741
742// GetResolvedStorePaths returns the store paths that are resolved (in lockfile)
743func (p *Package) GetResolvedStorePaths() ([]string, error) {

Callers

nothing calls this directly

Calls 5

GetOutputNamesMethod · 0.95
FunctionTimerFunction · 0.92
EndMethod · 0.80

Tested by

no test coverage detected