download

package
v1.6.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(ctx context.Context, rawURL string, opts ...Option) (io.ReadCloser, error)
func Head(ctx context.Context, rawURL string) (int, error)

Types

type CredentialResolver added in v1.4.1

type CredentialResolver interface {
	Resolve(ctx context.Context, protocol, host, path string) (username, password string, err error)
}

CredentialResolver resolves a username/password (token) for a host, used to authenticate downloads of private assets.

type GithubRelease

type GithubRelease struct {
	Assets []GithubReleaseAsset `json:"assets,omitempty"`
}

type GithubReleaseAsset

type GithubReleaseAsset struct {
	ID   int    `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type HTTPStatusError

type HTTPStatusError struct {
	StatusCode int
	URL        string
	Body       string
}

HTTPStatusError wraps HTTP status code errors for better error handling.

func (*HTTPStatusError) Error

func (e *HTTPStatusError) Error() string

type Option added in v1.4.1

type Option func(*options)

Option configures a download.

func WithCredentialResolver added in v1.4.1

func WithCredentialResolver(resolver CredentialResolver) Option

WithCredentialResolver enables authenticated retries for private assets.

Jump to

Keyboard shortcuts

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