download

package
v2.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChecksumDownloader

type ChecksumDownloader interface {
	DownloadChecksum(ctx context.Context, logE *logrus.Entry, rt *runtime.Runtime, pkg *config.Package) (io.ReadCloser, int64, error)
}

type ChecksumDownloaderImpl

type ChecksumDownloaderImpl struct {
	// contains filtered or unexported fields
}

func NewChecksumDownloader

func NewChecksumDownloader(gh github.RepositoriesService, rt *runtime.Runtime, httpDownloader HTTPDownloader) *ChecksumDownloaderImpl

func (*ChecksumDownloaderImpl) DownloadChecksum

func (dl *ChecksumDownloaderImpl) DownloadChecksum(ctx context.Context, logE *logrus.Entry, rt *runtime.Runtime, pkg *config.Package) (io.ReadCloser, int64, error)

type ClientAPI

type ClientAPI interface {
	ReadCloser(ctx context.Context, logE *logrus.Entry, file *File) (io.ReadCloser, int64, error)
}

type DownloadedFile added in v2.7.1

type DownloadedFile struct {
	// contains filtered or unexported fields
}

func NewDownloadedFile added in v2.7.1

func NewDownloadedFile(fs afero.Fs, body io.ReadCloser, pb *progressbar.ProgressBar) *DownloadedFile

func (*DownloadedFile) Close added in v2.7.1

func (f *DownloadedFile) Close() error

func (*DownloadedFile) Path added in v2.11.0

func (f *DownloadedFile) Path() (string, error)

func (*DownloadedFile) Read added in v2.7.1

func (f *DownloadedFile) Read() (io.ReadCloser, error)

func (*DownloadedFile) ReadLast added in v2.7.1

func (f *DownloadedFile) ReadLast() (io.ReadCloser, error)

func (*DownloadedFile) Remove added in v2.7.1

func (f *DownloadedFile) Remove() error

func (*DownloadedFile) Wrap added in v2.7.1

func (f *DownloadedFile) Wrap(w io.Writer) io.Writer

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

func NewDownloader

func NewDownloader(gh github.RepositoriesService, httpDownloader HTTPDownloader) *Downloader

func (*Downloader) ReadCloser added in v2.11.0

func (dl *Downloader) ReadCloser(ctx context.Context, logE *logrus.Entry, file *File) (io.ReadCloser, int64, error)

type File

type File struct {
	Type      string
	RepoOwner string
	RepoName  string
	Version   string
	Asset     string
	URL       string
	Path      string
	Private   bool
}

func ConvertDownloadedFileToFile

func ConvertDownloadedFileToFile(file *registry.DownloadedFile, art *File, rt *runtime.Runtime, tplParam *template.Artifact) (*File, error)

func ConvertPackageToFile

func ConvertPackageToFile(pkg *config.Package, assetName string, rt *runtime.Runtime) (*File, error)

func ConvertRegistryToFile

func ConvertRegistryToFile(rgst *aqua.Registry) (*File, error)

type GitHubContentAPI

type GitHubContentAPI interface {
	DownloadContents(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error)
}

type GitHubContentFileDownloader

type GitHubContentFileDownloader struct {
	// contains filtered or unexported fields
}

func NewGitHubContentFileDownloader

func NewGitHubContentFileDownloader(gh GitHubContentAPI, httpDL HTTPDownloader) *GitHubContentFileDownloader

func (*GitHubContentFileDownloader) DownloadGitHubContentFile

type GitHubReleaseAPI

type GitHubReleaseAPI interface {
	GetReleaseByTag(ctx context.Context, owner, repoName, version string) (*github.RepositoryRelease, *github.Response, error)
	DownloadReleaseAsset(ctx context.Context, owner, repoName string, assetID int64, httpClient *http.Client) (io.ReadCloser, string, error)
}

type GitHubReleaseDownloader

type GitHubReleaseDownloader struct {
	// contains filtered or unexported fields
}

func NewGitHubReleaseDownloader

func NewGitHubReleaseDownloader(gh GitHubReleaseAPI, httpDL HTTPDownloader) *GitHubReleaseDownloader

func (*GitHubReleaseDownloader) DownloadGitHubRelease

func (dl *GitHubReleaseDownloader) DownloadGitHubRelease(ctx context.Context, logE *logrus.Entry, param *domain.DownloadGitHubReleaseParam) (io.ReadCloser, int64, error)

type HTTPDownloader

type HTTPDownloader interface {
	Download(ctx context.Context, u string) (io.ReadCloser, int64, error)
}

func NewHTTPDownloader

func NewHTTPDownloader(httpClient *http.Client) HTTPDownloader

type Mock

type Mock struct {
	RC   io.ReadCloser
	Code int64
	Err  error
}

func (*Mock) ReadCloser added in v2.11.0

func (m *Mock) ReadCloser(ctx context.Context, logE *logrus.Entry, file *File) (io.ReadCloser, int64, error)

type MockChecksumDownloader

type MockChecksumDownloader struct {
	Body string
	Code int64
	Err  error
}

func (*MockChecksumDownloader) DownloadChecksum

func (dl *MockChecksumDownloader) DownloadChecksum(ctx context.Context, logE *logrus.Entry, rt *runtime.Runtime, pkg *config.Package) (io.ReadCloser, int64, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL