downloader

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DockerHubRegistry = "registry-1.docker.io"
View Source
const (
	HeaderWWWAuthenticate = "www-authenticate"
)

Variables

This section is empty.

Functions

func WriteTo

func WriteTo(reader io.Reader, dir, file string) (err error)

Types

type DefaultOCIDownloader added in v0.0.21

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

func (*DefaultOCIDownloader) Download added in v0.0.21

func (d *DefaultOCIDownloader) Download(image, tag, file string) (reader io.Reader, err error)

func (*DefaultOCIDownloader) WithBasicAuth added in v0.0.21

func (d *DefaultOCIDownloader) WithBasicAuth(username string, password string)

func (*DefaultOCIDownloader) WithContext added in v0.0.21

func (d *DefaultOCIDownloader) WithContext(ctx context.Context)

func (*DefaultOCIDownloader) WithInsecure added in v0.0.21

func (d *DefaultOCIDownloader) WithInsecure(insecure bool)

func (*DefaultOCIDownloader) WithOptions added in v0.0.21

func (d *DefaultOCIDownloader) WithOptions(opts ...OICDownloaderOption)

func (*DefaultOCIDownloader) WithRegistry added in v0.0.21

func (d *DefaultOCIDownloader) WithRegistry(registry string)

func (*DefaultOCIDownloader) WithRoundTripper added in v0.0.21

func (d *DefaultOCIDownloader) WithRoundTripper(rt http.RoundTripper)

func (*DefaultOCIDownloader) WithTimeout added in v0.0.21

func (d *DefaultOCIDownloader) WithTimeout(timeout time.Duration)

type ExtensionDownloader added in v0.0.21

type ExtensionDownloader struct {
	OCIDownloader
	// contains filtered or unexported fields
}

func (*ExtensionDownloader) Download added in v0.0.21

func (d *ExtensionDownloader) Download(name, tag, _ string) (reader io.Reader, err error)

func (*ExtensionDownloader) GetTargetFile added in v0.0.21

func (d *ExtensionDownloader) GetTargetFile(name string) string

func (*ExtensionDownloader) WithArch added in v0.0.21

func (d *ExtensionDownloader) WithArch(arch string)

func (*ExtensionDownloader) WithImagePrefix added in v0.0.21

func (d *ExtensionDownloader) WithImagePrefix(imagePrefix string)

func (*ExtensionDownloader) WithKind added in v0.0.21

func (d *ExtensionDownloader) WithKind(kind string)

func (*ExtensionDownloader) WithOS added in v0.0.21

func (d *ExtensionDownloader) WithOS(os string)

type ExtensionDownloaderOption added in v0.0.21

type ExtensionDownloaderOption func(*ExtensionDownloader)

func WithArch added in v0.0.21

func WithArch(arch string) ExtensionDownloaderOption

func WithImagePrefix added in v0.0.21

func WithImagePrefix(imagePrefix string) ExtensionDownloaderOption

func WithKind added in v0.0.21

func WithKind(kind string) ExtensionDownloaderOption

func WithOS added in v0.0.21

type ImageTagList

type ImageTagList struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

type Layer

type Layer struct {
	Annotations map[string]string `json:"annotations"`
	Digest      string            `json:"digest"`
}

type Manifest

type Manifest struct {
	Config      map[string]interface{} `json:"config"`
	Layers      []Layer                `json:"layers"`
	Annotations map[string]string      `json:"annotations"`
}

type NotFoundError added in v0.0.21

type NotFoundError struct {
	Item, Resource string
}

func (NotFoundError) Error added in v0.0.21

func (e NotFoundError) Error() string

type OCIDownloader

type OCIDownloader interface {
	WithBasicAuth(username string, password string)
	WithRegistry(string)
	WithRoundTripper(http.RoundTripper)
	WithInsecure(bool)
	WithTimeout(time.Duration)
	WithContext(context.Context)
	Download(image, tag, file string) (reader io.Reader, err error)
	WithOptions(opts ...OICDownloaderOption)
}

func NewDefaultOCIDownloader

func NewDefaultOCIDownloader(opts ...OICDownloaderOption) OCIDownloader

type OICDownloaderOption added in v0.0.21

type OICDownloaderOption func(*DefaultOCIDownloader)

func WithContext added in v0.0.21

func WithContext(ctx context.Context) OICDownloaderOption

func WithInsecure added in v0.0.21

func WithInsecure(insecure bool) OICDownloaderOption

func WithRegistry added in v0.0.21

func WithRegistry(registry string) OICDownloaderOption

func WithRoundTripper added in v0.0.21

func WithRoundTripper(rt http.RoundTripper) OICDownloaderOption

func WithSkipLayer added in v0.0.21

func WithSkipLayer(skipFunc func(layer *Layer) bool) OICDownloaderOption

func WithTimeout added in v0.0.21

func WithTimeout(timeout time.Duration) OICDownloaderOption

type PlatformAwareOCIDownloader

type PlatformAwareOCIDownloader interface {
	OCIDownloader
	WithOS(string)
	WithArch(string)
	GetTargetFile(string) string
	WithKind(string)
	WithImagePrefix(string)
}

type ProgressReader added in v0.0.18

type ProgressReader interface {
	io.Reader
	Withoutput(io.Writer)
	SetLength(int64)
	SetTitle(string)
}

func NewProgressReader added in v0.0.18

func NewProgressReader(r io.Reader) ProgressReader

type RegistryAuth

type RegistryAuth struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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