MCPcopy Create free account
hub / github.com/ddev/ddev / DownloadFile

Function DownloadFile

pkg/util/network.go:24–26  ·  view source on GitHub ↗

DownloadFile retrieves a file with retry logic, optional progress bar, and SHA256 verification.

(destPath string, fileURL string, progressBar bool, shaSumURL string)

Source from the content-addressed store, hash-verified

22
23// DownloadFile retrieves a file with retry logic, optional progress bar, and SHA256 verification.
24func DownloadFile(destPath string, fileURL string, progressBar bool, shaSumURL string) (err error) {
25 return DownloadFileExtended(destPath, fileURL, progressBar, shaSumURL, 2, 20*time.Minute)
26}
27
28// DownloadFileExtended retrieves a file with retry logic, optional progress bar, and SHA256 verification.
29// It allows specifying the number of retries and timeout duration.

Callers 6

DownloadMutagenFunction · 0.92
DownloadDockerComposeFunction · 0.92
GetCachedArchiveFunction · 0.92
TestDownloadFileFunction · 0.92

Calls 1

DownloadFileExtendedFunction · 0.85

Tested by 2

TestDownloadFileFunction · 0.74