downloader

package
v0.61.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkipDownload = errors.New("skip download")

Functions

func Download

func Download(ctx context.Context, src, dst, pwd string, opts Options) (string, error)

Download downloads the configured source to the destination.

func DownloadToTempDir

func DownloadToTempDir(ctx context.Context, src string, opts Options) (string, error)

DownloadToTempDir downloads the configured source to a temp dir.

func NewGitHubTransport

func NewGitHubTransport(u *url.URL, insecure bool, token string) http.RoundTripper

Types

type Auth

type Auth struct {
	Username string
	Password string
	Token    string
}

type CustomTransport

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

func NewCustomTransport

func NewCustomTransport(opts Options) *CustomTransport

func (*CustomTransport) RoundTrip

func (t *CustomTransport) RoundTrip(req *http.Request) (*http.Response, error)

type GitHubContentTransport

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

GitHubContentTransport is a round tripper for downloading the GitHub content.

func (*GitHubContentTransport) RoundTrip

func (t *GitHubContentTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip calls the GitHub API to download the content.

type Options

type Options struct {
	Insecure   bool
	Auth       Auth
	ETag       string
	ClientMode getter.ClientMode
}

Jump to

Keyboard shortcuts

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