download

package
v1.26.1-1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 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 struct {
	// contains filtered or unexported fields
}

func NewChecksumDownloader added in v1.18.0

func NewChecksumDownloader(gh domain.RepositoriesService, rt *runtime.Runtime, httpDownloader HTTPDownloader) *ChecksumDownloader

func (*ChecksumDownloader) DownloadChecksum added in v1.18.0

func (dl *ChecksumDownloader) 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 domain.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 `validate:"required" json:"type" jsonschema:"enum=github_release,enum=http"`
	RepoOwner string `yaml:"repo_owner,omitempty" json:"repo_owner,omitempty"`
	RepoName  string `yaml:"repo_name,omitempty" json:"repo_name,omitempty"`
	Version   string `yaml:",omitempty" json:"version,omitempty"`
	Asset     string `json:"asset,omitempty" yaml:",omitempty"`
	URL       string `json:"url,omitempty" yaml:",omitempty"`
	Path      string `json:"path,omitempty" yaml:",omitempty"`
}

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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