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

Interface Getter

get.go:29–54  ·  view source on GitHub ↗

Getter defines the interface that schemes must implement to download things.

Source from the content-addressed store, hash-verified

27// Getter defines the interface that schemes must implement to download
28// things.
29type Getter interface {
30 // Get downloads the given URL into the given directory. This always
31 // assumes that we're updating and gets the latest version that it can.
32 //
33 // The directory may already exist (if we're updating). If it is in a
34 // format that isn't understood, an error should be returned. Get shouldn't
35 // simply nuke the directory.
36 Get(context.Context, *Request) error
37
38 // GetFile downloads the give URL into the given path. The URL must
39 // reference a single file. If possible, the Getter should check if
40 // the remote end contains the same file and no-op this operation.
41 GetFile(context.Context, *Request) error
42
43 // Mode returns the mode based on the given URL. This is used to
44 // allow clients to let the getters decide which mode to use.
45 Mode(context.Context, *url.URL) (Mode, error)
46
47 // Detect detects whether the Request.Src matches a known pattern to
48 // turn it into a proper URL, and also transforms and update Request.Src
49 // when necessary.
50 // The Getter must validate if the Request.Src is a valid URL
51 // with a valid scheme for the Getter, and also check if the
52 // current Getter is the forced one and return true if that's the case.
53 Detect(*Request) (bool, error)
54}
55
56// Getters is the mapping of scheme to the Getter implementation that will
57// be used to get a dependency.

Callers 50

TestGetFile_checksumURLFunction · 0.65
TestGetFile_checksumSkipFunction · 0.65
TestGetFile_inplaceFunction · 0.65
TestHgGetterFunction · 0.65
TestHgGetter_branchFunction · 0.65
TestGet_progressFunction · 0.65
GetMethod · 0.65
TestHgGetter_GetFileFunction · 0.65
TestHttpGetter_fileFunction · 0.65
TestGitGetter_GetFileFunction · 0.65

Implementers 9

SmbClientGetterget_smbclient.go
HgGetterget_hg.go
FileGetterget_file.go
GitGetterget_git.go
SmbMountGetterget_smb_mount.go
HttpGetterget_http.go
MockGetterget_mock.go
Gettergcs/get_gcs.go
Getters3/get_s3.go

Calls

no outgoing calls

Tested by

no test coverage detected