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
()
| 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 |
| 714 | func (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) |
| 743 | func (p *Package) GetResolvedStorePaths() ([]string, error) { |
nothing calls this directly
no test coverage detected