MCPcopy Index your code
hub / github.com/jetify-com/devbox / ResolveV2

Method ResolveV2

internal/searcher/client.go:69–86  ·  view source on GitHub ↗

Resolve calls the /resolve endpoint of the search service. This returns the latest version of the package that matches the version constraint.

(ctx context.Context, name, version string)

Source from the content-addressed store, hash-verified

67// Resolve calls the /resolve endpoint of the search service. This returns
68// the latest version of the package that matches the version constraint.
69func (c *client) ResolveV2(ctx context.Context, name, version string) (*ResolveResponse, error) {
70 if name == "" {
71 return nil, redact.Errorf("name is empty")
72 }
73 if version == "" {
74 return nil, redact.Errorf("version is empty")
75 }
76
77 endpoint, err := url.JoinPath(c.host, "v2/resolve")
78 if err != nil {
79 return nil, redact.Errorf("invalid search endpoint host %q: %w", redact.Safe(c.host), redact.Safe(err))
80 }
81 searchURL := endpoint +
82 "?name=" + url.QueryEscape(name) +
83 "&version=" + url.QueryEscape(version)
84
85 return execGet[ResolveResponse](ctx, searchURL)
86}
87
88var userAgent = fmt.Sprintf("Devbox/%s (%s; %s)", build.Version, runtime.GOOS, runtime.GOARCH)
89

Callers 3

phpExtensionsMethod · 0.80
determineBestVersionFunction · 0.80
resolveV2Function · 0.80

Calls 2

ErrorfFunction · 0.92
SafeFunction · 0.92

Tested by

no test coverage detected