download

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(u string, fname string, byteLimit int64) (alternativeName string, err error)

Download a file and limit the number of bytes. If the bytes exceed, it will throw an error and delete the downloaded file.

func Youtube

func Youtube(u string, fname string) (alternativeName string, err error)

Types

type PassThru

type PassThru struct {
	io.Reader
	// contains filtered or unexported fields
}

PassThru wraps an existing io.Reader.

It simply forwards the Read() call, while displaying the results from individual calls to it.

func (*PassThru) Read

func (pt *PassThru) Read(p []byte) (int, error)

Read 'overrides' the underlying io.Reader's Read method. This is the one that will be called by io.Copy(). We simply use it to keep track of byte counts and then forward the call.

Jump to

Keyboard shortcuts

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