Versions in this module Expand all Collapse all v1 v1.5.5 Jun 1, 2021 Changes in this version + var Decompressors map[string]Decompressor + var Detectors []Detector + var Getters map[string]Getter + func Copy(ctx context.Context, dst io.Writer, src io.Reader) (int64, error) + func Detect(src string, pwd string, ds []Detector) (string, error) + func Get(dst, src string, opts ...ClientOption) error + func GetAny(dst, src string, opts ...ClientOption) error + func GetFile(dst, src string, opts ...ClientOption) error + func SourceDirSubdir(src string) (string, string) + func SubdirGlob(dst, subDir string) (string, error) + func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) + func WithContext(ctx context.Context) func(*Client) error + func WithInsecure() func(*Client) error + func WithProgress(pl ProgressTracker) func(*Client) error + type BitBucketDetector struct + func (d *BitBucketDetector) Detect(src, _ string) (string, bool, error) + type Bzip2Decompressor struct + func (d *Bzip2Decompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error + type ChecksumError struct + Actual []byte + Expected []byte + File string + Hash hash.Hash + func (cerr *ChecksumError) Error() string + type Client struct + Ctx context.Context + Decompressors map[string]Decompressor + Detectors []Detector + Dir bool + Dst string + Getters map[string]Getter + Insecure bool + Mode ClientMode + Options []ClientOption + ProgressListener ProgressTracker + Pwd string + Src string + Umask os.FileMode + func (c *Client) ChecksumFromFile(checksumFile string, src *url.URL) (*FileChecksum, error) + func (c *Client) Configure(opts ...ClientOption) error + func (c *Client) Get() error + type ClientMode uint + const ClientModeAny + const ClientModeDir + const ClientModeFile + const ClientModeInvalid + type ClientOption func(*Client) error + type Decompressor interface + Decompress func(dst, src string, dir bool, umask os.FileMode) error + type Detector interface + Detect func(string, string) (string, bool, error) + type FileChecksum struct + Filename string + Hash hash.Hash + Type string + Value []byte + type FileDetector struct + func (d *FileDetector) Detect(src, pwd string) (string, bool, error) + type FileGetter struct + Copy bool + func (g *FileGetter) ClientMode(u *url.URL) (ClientMode, error) + func (g *FileGetter) Context() context.Context + func (g *FileGetter) Get(dst string, u *url.URL) error + func (g *FileGetter) GetFile(dst string, u *url.URL) error + func (g *FileGetter) SetClient(c *Client) + type FolderStorage struct + StorageDir string + func (s *FolderStorage) Dir(key string) (d string, e bool, err error) + func (s *FolderStorage) Get(key string, source string, update bool) error + type GCSDetector struct + func (d *GCSDetector) Detect(src, _ string) (string, bool, error) + type GCSGetter struct + func (g *GCSGetter) ClientMode(u *url.URL) (ClientMode, error) + func (g *GCSGetter) Context() context.Context + func (g *GCSGetter) Get(dst string, u *url.URL) error + func (g *GCSGetter) GetFile(dst string, u *url.URL) error + func (g *GCSGetter) SetClient(c *Client) + type Getter interface + ClientMode func(*url.URL) (ClientMode, error) + Get func(string, *url.URL) error + GetFile func(string, *url.URL) error + SetClient func(*Client) + type GitDetector struct + func (d *GitDetector) Detect(src, _ string) (string, bool, error) + type GitGetter struct + func (g *GitGetter) ClientMode(_ *url.URL) (ClientMode, error) + func (g *GitGetter) Context() context.Context + func (g *GitGetter) Get(dst string, u *url.URL) error + func (g *GitGetter) GetFile(dst string, u *url.URL) error + func (g *GitGetter) SetClient(c *Client) + type GitHubDetector struct + func (d *GitHubDetector) Detect(src, _ string) (string, bool, error) + type GitLabDetector struct + func (d *GitLabDetector) Detect(src, _ string) (string, bool, error) + type GzipDecompressor struct + func (d *GzipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error + type HgGetter struct + func (g *HgGetter) ClientMode(_ *url.URL) (ClientMode, error) + func (g *HgGetter) Context() context.Context + func (g *HgGetter) Get(dst string, u *url.URL) error + func (g *HgGetter) GetFile(dst string, u *url.URL) error + func (g *HgGetter) SetClient(c *Client) + type HttpGetter struct + Client *http.Client + Header http.Header + Netrc bool + func (g *HttpGetter) ClientMode(u *url.URL) (ClientMode, error) + func (g *HttpGetter) Context() context.Context + func (g *HttpGetter) Get(dst string, u *url.URL) error + func (g *HttpGetter) GetFile(dst string, src *url.URL) error + func (g *HttpGetter) SetClient(c *Client) + type MockGetter struct + GetCalled bool + GetDst string + GetErr error + GetFileCalled bool + GetFileDst string + GetFileErr error + GetFileURL *url.URL + GetURL *url.URL + Proxy Getter + func (g *MockGetter) ClientMode(u *url.URL) (ClientMode, error) + func (g *MockGetter) Context() context.Context + func (g *MockGetter) Get(dst string, u *url.URL) error + func (g *MockGetter) GetFile(dst string, u *url.URL) error + func (g *MockGetter) SetClient(c *Client) + type ProgressTracker interface + TrackProgress func(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) + type S3Detector struct + func (d *S3Detector) Detect(src, _ string) (string, bool, error) + type S3Getter struct + func (g *S3Getter) ClientMode(u *url.URL) (ClientMode, error) + func (g *S3Getter) Context() context.Context + func (g *S3Getter) Get(dst string, u *url.URL) error + func (g *S3Getter) GetFile(dst string, u *url.URL) error + func (g *S3Getter) SetClient(c *Client) + type Storage interface + Dir func(string) (string, bool, error) + Get func(string, string, bool) error + type TarBzip2Decompressor struct + func (d *TarBzip2Decompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error + type TarGzipDecompressor struct + func (d *TarGzipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error + type TarXzDecompressor struct + func (d *TarXzDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error + type TarZstdDecompressor struct + func (d *TarZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error + type TestDecompressCase struct + Dir bool + DirList []string + Err bool + FileMD5 string + Input string + Mtime *time.Time + type XzDecompressor struct + func (d *XzDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error + type ZipDecompressor struct + func (d *ZipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error + type ZstdDecompressor struct + func (d *ZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error