download

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

type Downloader interface {
	Get(ctx context.Context, url string) (io.Reader, error)
	Close()
}

Downloader is an interface to download programs

type HTTP

type HTTP struct {
	UseCache bool
	// contains filtered or unexported fields
}

HTTP implements Downloader which downloads programs through net/http

func (*HTTP) Close

func (d *HTTP) Close()

func (*HTTP) Get

func (d *HTTP) Get(ctx context.Context, url string) (io.Reader, error)

type LocalFile

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

LocalFile implements Downloader, which simulates download through filesystem.

func NewLocalFile

func NewLocalFile(r io.ReadCloser) *LocalFile

func (*LocalFile) Close

func (l *LocalFile) Close()

func (*LocalFile) Get

func (l *LocalFile) Get(ctx context.Context, url string) (io.Reader, error)

Jump to

Keyboard shortcuts

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