MCPcopy
hub / github.com/NVIDIA/aistore / DownloadWithParam

Function DownloadWithParam

api/download.go:44–57  ·  view source on GitHub ↗
(baseParams BaseParams, dlt downloader.DlType, body interface{})

Source from the content-addressed store, hash-verified

42}
43
44func DownloadWithParam(baseParams BaseParams, dlt downloader.DlType, body interface{}) (id string, err error) {
45 baseParams.Method = http.MethodPost
46 msg := cos.MustMarshal(body)
47 reqParams := AllocRp()
48 {
49 reqParams.BaseParams = baseParams
50 reqParams.Path = apc.URLPathDownload.S
51 reqParams.Body = cos.MustMarshal(downloader.DlBody{Type: dlt, RawMessage: msg})
52 reqParams.Header = http.Header{cos.HdrContentType: []string{cos.ContentJSON}}
53 }
54 id, err = reqParams.doDlDownloadRequest()
55 FreeRp(reqParams)
56 return
57}
58
59func DownloadMulti(baseParams BaseParams, description string, bck cmn.Bck, msg interface{}, intervals ...time.Duration) (string, error) {
60 dlBody := downloader.DlMultiBody{}

Callers 11

startDownloadHandlerFunction · 0.92
downloadObjectRemoteFunction · 0.92
TestDownloadTimeoutFunction · 0.92
TestDownloadRemoteFunction · 0.92
DownloadSingleFunction · 0.85
DownloadRangeFunction · 0.85
DownloadMultiFunction · 0.85
DownloadBackendFunction · 0.85

Calls 4

MustMarshalFunction · 0.92
AllocRpFunction · 0.85
FreeRpFunction · 0.85
doDlDownloadRequestMethod · 0.80

Tested by 6

downloadObjectRemoteFunction · 0.74
TestDownloadTimeoutFunction · 0.74
TestDownloadRemoteFunction · 0.74