download

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChecksumDownloader added in v1.18.0

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

type ChecksumDownloaderImpl added in v1.29.0

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

func NewChecksumDownloader added in v1.18.0

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

func (*ChecksumDownloaderImpl) DownloadChecksum added in v1.29.0

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

type ClientAPI added in v1.26.0

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

type Downloader added in v1.26.0

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

func NewDownloader added in v1.26.0

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

func (*Downloader) GetReadCloser added in v1.26.0

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

type File added in v1.26.0

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

func ConvertDownloadedFileToFile added in v1.26.0

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

func ConvertPackageToFile added in v1.26.0

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

func ConvertRegistryToFile added in v1.26.0

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

type GitHubContentAPI added in v1.18.0

type GitHubContentAPI interface {
	GetContents(ctx context.Context, repoOwner, repoName, path string, opt *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
}

type GitHubContentFileDownloader added in v1.18.0

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

func NewGitHubContentFileDownloader added in v1.18.0

func NewGitHubContentFileDownloader(gh GitHubContentAPI, httpDL HTTPDownloader) *GitHubContentFileDownloader

func (*GitHubContentFileDownloader) DownloadGitHubContentFile added in v1.18.0

func (dl *GitHubContentFileDownloader) DownloadGitHubContentFile(ctx context.Context, logE *logrus.Entry, param *domain.GitHubContentFileParam) (*domain.GitHubContentFile, error)

type GitHubReleaseAPI added in v1.18.0

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 added in v1.18.0

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

func NewGitHubReleaseDownloader added in v1.18.0

func NewGitHubReleaseDownloader(gh GitHubReleaseAPI, httpDL HTTPDownloader) *GitHubReleaseDownloader

func (*GitHubReleaseDownloader) DownloadGitHubRelease added in v1.18.0

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

type HTTPDownloader added in v1.6.1

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

func NewHTTPDownloader added in v1.6.1

func NewHTTPDownloader(httpClient *http.Client) HTTPDownloader

type Mock added in v1.26.0

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

func (*Mock) GetReadCloser added in v1.26.0

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

type MockChecksumDownloader added in v1.29.0

type MockChecksumDownloader struct {
	Body string
	Code int64
	Err  error
}

func (*MockChecksumDownloader) DownloadChecksum added in v1.29.0

func (chkDL *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