dolo

package module
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 7 Imported by: 14

README

dolo

Golang module for file download. Dolo skips downloading if the file exists and has the same content length. Dolo supports an optional callback that notifies on progress.

Exported methods

  • NewClient(httpClient *http.Client, notify func(uint64, uint64)) - creates a new dolo client using the provided http.Client (with cookie jar, etc.) and an optional callback to notify on progress. Optional callback takes two values - downloaded bytes and total bytes.

  • Download(url *url.URL, dstDir string, overwrite bool) - downloads a resource at the URL to the destination directory (original resource base path would be used for a filename). Overwrite would require download even if the destination file already exists and has the same content length.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(httpClient *http.Client, notify func(uint64, uint64)) *Client

func (*Client) Download

func (dolo *Client) Download(url *url.URL, dstDir string, overwrite bool) error

Jump to

Keyboard shortcuts

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