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

Method DownloadPlugin

api/plugin/download_plugin.go:5–23  ·  view source on GitHub ↗
(pluginURL string, path string, proxyReader ProxyReader)

Source from the content-addressed store, hash-verified

3import "os"
4
5func (client *Client) DownloadPlugin(pluginURL string, path string, proxyReader ProxyReader) error {
6 request, err := client.newGETRequest(pluginURL)
7 if err != nil {
8 return err
9 }
10
11 response := Response{}
12 err = client.connection.Make(request, &response, proxyReader)
13 if err != nil {
14 return err
15 }
16
17 err = os.WriteFile(path, response.RawResponse, 0700)
18 if err != nil {
19 return err
20 }
21
22 return nil
23}

Callers

nothing calls this directly

Calls 2

newGETRequestMethod · 0.95
MakeMethod · 0.65

Tested by

no test coverage detected