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: 0

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