downloader

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DepDownloader

type DepDownloader struct {
	*OciDownloader
	*GitDownloader
}

DepDownloader is the downloader for the package. Only support the OCI and git source.

func NewOciDownloader

func NewOciDownloader(platform string) *DepDownloader

func (*DepDownloader) Download

func (d *DepDownloader) Download(opts DownloadOptions) error

type DownloadOptions

type DownloadOptions struct {
	// LocalPath is the local path to download the package.
	LocalPath string
	// Source is the source of the package. including git, oci, local.
	Source pkg.Source
	// Settings is the default settings and authrization information.
	Settings settings.Settings
	// LogWriter is the writer to write the log.
	LogWriter io.Writer
}

DownloadOptions is the options for downloading a package.

func NewDownloadOptions

func NewDownloadOptions(opts ...Option) *DownloadOptions

type Downloader

type Downloader interface {
	Download(opts DownloadOptions) error
}

Downloader is the interface for downloading a package.

type GitDownloader

type GitDownloader struct{}

GitDownloader is the downloader for the git source.

func (*GitDownloader) Download

func (d *GitDownloader) Download(opts DownloadOptions) error

type OciDownloader

type OciDownloader struct {
	Platform string
}

OciDownloader is the downloader for the OCI source.

func (*OciDownloader) Download

func (d *OciDownloader) Download(opts DownloadOptions) error

type Option

type Option func(*DownloadOptions)

func WithLocalPath

func WithLocalPath(localPath string) Option

func WithLogWriter

func WithLogWriter(logWriter io.Writer) Option

func WithSettings

func WithSettings(settings settings.Settings) Option

func WithSource

func WithSource(source pkg.Source) Option

type Platform

type Platform struct {
	PlatformSpec string
	Platform     *v1.Platform
}

Platform option struct.

Jump to

Keyboard shortcuts

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