MCPcopy Index your code
hub / github.com/cloudfoundry/cli / GetPluginRepository

Method GetPluginRepository

api/plugin/plugin_repository.go:27–53  ·  view source on GitHub ↗
(repositoryURL string)

Source from the content-addressed store, hash-verified

25}
26
27func (client *Client) GetPluginRepository(repositoryURL string) (PluginRepository, error) {
28 parsedURL, err := url.Parse(repositoryURL)
29 if err != nil {
30 return PluginRepository{}, err
31 }
32
33 parsedURL.Path = strings.TrimSuffix(parsedURL.Path, "/")
34 if !strings.HasSuffix(parsedURL.Path, "/list") {
35 parsedURL.Path = path.Join(parsedURL.Path, "list")
36 }
37
38 request, err := client.newGETRequest(parsedURL.String())
39 if err != nil {
40 return PluginRepository{}, err
41 }
42
43 var pluginRepository PluginRepository
44 response := Response{
45 Result: &pluginRepository,
46 }
47 err = client.connection.Make(request, &response, nil)
48 if err != nil {
49 return PluginRepository{}, err
50 }
51
52 return pluginRepository, nil
53}

Callers

nothing calls this directly

Calls 4

newGETRequestMethod · 0.95
ParseMethod · 0.65
StringMethod · 0.65
MakeMethod · 0.65

Tested by

no test coverage detected