dl

package
v10.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2018 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIntegrity

func CheckIntegrity(consumer *state.Consumer, header http.Header, contentLength int64, file string) error

func Do

func Do(ctx *mansion.Context, url string, dest string) (int64, error)

func IsIntegrityError

func IsIntegrityError(err error) bool

IsIntegrityError returns true if the error is a size or a hash mismatch. Simple reference equality cannot be used because the error might be wrapped (for stack traces)

func Register

func Register(ctx *mansion.Context)

Types

type BadHashErr

type BadHashErr struct {
	Algo     string
	Expected []byte
	Actual   []byte
}

BadHashErr is returned when the hash of a file on disk doesn't match what we expected it to be

func (*BadHashErr) Error

func (bhe *BadHashErr) Error() string

type BadSizeErr

type BadSizeErr struct {
	Expected int64
	Actual   int64
}

BadSizeErr is returned when the size of a file on disk doesn't match what we expected it to be

func (*BadSizeErr) Error

func (bse *BadSizeErr) Error() string

Jump to

Keyboard shortcuts

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