dlhttp

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Copier

type Copier interface {
	Copy(dstinfo Info, src io.Reader) error
}

type DefaultCopier

type DefaultCopier struct{}

func (DefaultCopier) Copy

func (c DefaultCopier) Copy(dstinfo Info, src io.Reader) error

type Downloader

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

Downloader implements Downloader over HTTP protocol.

func NewDownloader

func NewDownloader(ctx context.Context, client http.Client) *Downloader

NewDownloader creates a new http downloader. if ctx is nil, it will be set to context.Background().

func (*Downloader) Download

func (dler *Downloader) Download(info Info) error

Download downloads using given info.

type Info

type Info struct {
	URL    string
	Output io.Writer

	//HTTP related
	Method  string
	Headers http.Header
	Body    io.Reader
}

Jump to

Keyboard shortcuts

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