Versions in this module Expand all Collapse all v1 v1.3.1 Sep 23, 2019 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 WithProgress(pl ProgressTracker) func(*Client) error + type Bzip2Decompressor struct + func (d *Bzip2Decompressor) Decompress(dst, src string, dir bool) 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 + Mode ClientMode + Options []ClientOption + ProgressListener ProgressTracker + Pwd string + Src string + 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) 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 Getter interface + ClientMode func(*url.URL) (ClientMode, error) + Get func(string, *url.URL) error + GetFile func(string, *url.URL) error + SetClient func(*Client) + type GzipDecompressor struct + func (d *GzipDecompressor) Decompress(dst, src string, dir bool) error + 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 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) error + type TarGzipDecompressor struct + func (d *TarGzipDecompressor) Decompress(dst, src string, dir bool) error + type TarXzDecompressor struct + func (d *TarXzDecompressor) Decompress(dst, src string, dir bool) 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) error + type ZipDecompressor struct + func (d *ZipDecompressor) Decompress(dst, src string, dir bool) error