downloader

package
v0.52.0 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: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect(url string, dst string) (string, error)

Detect determines whether a url is a known source url from which we can download files. If a known source is found, the url is formatted, otherwise an error is returned.

func Download

func Download(ctx context.Context, dst string, urls []string) error

Download downloads the given policies into the given destination.

Types

type OCIDetector

type OCIDetector struct{}

OCIDetector implements Detector to detect OCI registry URLs and turn them into URLs that the OCI getter can understand.

func (*OCIDetector) Detect

func (d *OCIDetector) Detect(src, _ string) (string, bool, error)

Detect will detect if the source is an OCI registry.

type OCIGetter

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

OCIGetter is responsible for handling OCI repositories

func (*OCIGetter) ClientMode

func (g *OCIGetter) ClientMode(_ *url.URL) (getter.ClientMode, error)

ClientMode returns the client mode directory

func (*OCIGetter) Context

func (g *OCIGetter) Context() context.Context

Context tries to returns the Contex from the getter's client. otherwise context.Background() is returned.

func (*OCIGetter) Get

func (g *OCIGetter) Get(path string, u *url.URL) error

Get gets the repository as the specified url

func (*OCIGetter) GetFile

func (g *OCIGetter) GetFile(_ string, _ *url.URL) error

GetFile is currently a NOOP

func (*OCIGetter) SetClient

func (g *OCIGetter) SetClient(c *getter.Client)

SetClient sets the client for the OCIGetter NOTE: These methods are normally handled by the base getter in go-getter but the base getter is not exported

Jump to

Keyboard shortcuts

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