MCPcopy
hub / github.com/cortexlabs/cortex / HTTPUploadZip

Function HTTPUploadZip

cli/cluster/lib_http_client.go:142–154  ·  view source on GitHub ↗
(operatorConfig OperatorConfig, endpoint string, zipInput *archive.Input, fileName string, qParams ...map[string]string)

Source from the content-addressed store, hash-verified

140}
141
142func HTTPUploadZip(operatorConfig OperatorConfig, endpoint string, zipInput *archive.Input, fileName string, qParams ...map[string]string) ([]byte, error) {
143 zipBytes, _, err := archive.ZipToMem(zipInput)
144 if err != nil {
145 return nil, errors.Wrap(err, "failed to zip configuration file")
146 }
147
148 uploadInput := &HTTPUploadInput{
149 Bytes: map[string][]byte{
150 fileName: zipBytes,
151 },
152 }
153 return HTTPUpload(operatorConfig, endpoint, uploadInput, qParams...)
154}
155
156func operatorRequest(operatorConfig OperatorConfig, method string, endpoint string, body io.Reader, qParams ...map[string]string) (*http.Request, error) {
157 req, err := http.NewRequest(method, operatorConfig.OperatorEndpoint+endpoint, body)

Callers

nothing calls this directly

Calls 3

ZipToMemFunction · 0.92
WrapFunction · 0.92
HTTPUploadFunction · 0.85

Tested by

no test coverage detected