MCPcopy
hub / github.com/hashicorp/go-getter / GetFile

Function GetFile

get.go:130–137  ·  view source on GitHub ↗

GetFile downloads the file specified by src into the path specified by dst.

(ctx context.Context, dst, src string)

Source from the content-addressed store, hash-verified

128// GetFile downloads the file specified by src into the path specified by
129// dst.
130func GetFile(ctx context.Context, dst, src string) (*GetResult, error) {
131 req := &Request{
132 Src: src,
133 Dst: dst,
134 GetMode: ModeFile,
135 }
136 return DefaultClient.Get(ctx, req)
137}
138
139// getRunCommand is a helper that will run a command and capture the output
140// in the case an error happens.

Callers 9

TestGetFileFunction · 0.85
TestGetFile_archiveFunction · 0.85
TestGetFile_checksumFunction · 0.85
TestGet_progressFunction · 0.85
TestHttpGetter_resumeFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by 9

TestGetFileFunction · 0.68
TestGetFile_archiveFunction · 0.68
TestGetFile_checksumFunction · 0.68
TestGet_progressFunction · 0.68
TestHttpGetter_resumeFunction · 0.68