Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher can retrieve assets from various sources. It works by delegating to a handler for the scheme of the source URI.
func NewDefaultFetcher ¶
func NewDefaultFetcher() *Fetcher
NewDefaultFetcher creates a new fetcher with default handlers.
func NewFetcher ¶
NewFetcher creates a new fetcher.
type FileFetcher ¶
type FileFetcher struct {
// contains filtered or unexported fields
}
FileFetcher is a Fetcher that retrieves assets from a file. It handles the "file" scheme.
func (*FileFetcher) Fetch ¶
func (f *FileFetcher) Fetch(_ context.Context, uri *url.URL, destination string, expectedSum []byte, hasher hash.Hash) (bool, error)
Fetch retrieves a file from the local filesystem.
func (*FileFetcher) FetchUnchecked ¶
func (f *FileFetcher) FetchUnchecked(_ context.Context, uri *url.URL, destination string) (bool, error)
FetchUnchecked retrieves a file from the local filesystem without verifying its integrity.
type HTTPFetcher ¶
type HTTPFetcher struct {
// contains filtered or unexported fields
}
HTTPFetcher is a Fetcher that retrieves assets from http(s). It handles the "http" and "https" schemes.
func (*HTTPFetcher) Fetch ¶
func (f *HTTPFetcher) Fetch(ctx context.Context, uri *url.URL, destination string, expectedSum []byte, hasher hash.Hash) (bool, error)
Fetch retrieves a file from an HTTP server.
func (*HTTPFetcher) FetchUnchecked ¶
func (f *HTTPFetcher) FetchUnchecked(ctx context.Context, uri *url.URL, destination string) (bool, error)
FetchUnchecked retrieves a file from an HTTP server without verifying its integrity.