UploadBuildpack uploads the contents of a buildpack zip to the server.
(buildpackGUID string, buildpackPath string, buildpack io.Reader, buildpackLength int64)
| 64 | |
| 65 | // UploadBuildpack uploads the contents of a buildpack zip to the server. |
| 66 | func (client *Client) UploadBuildpack(buildpackGUID string, buildpackPath string, buildpack io.Reader, buildpackLength int64) (JobURL, Warnings, error) { |
| 67 | |
| 68 | contentLength, err := uploads.CalculateRequestSize(buildpackLength, buildpackPath, "bits") |
| 69 | if err != nil { |
| 70 | return "", nil, err |
| 71 | } |
| 72 | |
| 73 | contentType, body, writeErrors := uploads.CreateMultipartBodyAndHeader(buildpack, buildpackPath, "bits") |
| 74 | |
| 75 | responseLocation, warnings, err := client.MakeRequestUploadAsync( |
| 76 | internal.PostBuildpackBitsRequest, |
| 77 | internal.Params{"buildpack_guid": buildpackGUID}, |
| 78 | contentType, |
| 79 | body, |
| 80 | contentLength, |
| 81 | nil, |
| 82 | writeErrors, |
| 83 | ) |
| 84 | |
| 85 | return JobURL(responseLocation), warnings, err |
| 86 | } |
nothing calls this directly
no test coverage detected