download

package
v0.0.0-...-080ad10 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From(u *url.URL, destination string, options ...Option) error

func FromURL

func FromURL(rawURL string, destination string, options ...Option) error

Types

type Download

type Download struct {
	DownloadURL *url.URL    // URL from where artifact is being downloaded
	Destination string      // Where must this artifact be downloaded
	Validators  []Validator // Validators to check the downloaded artifact.
}

func New

func New(u *url.URL, destination string, options ...Option) (*Download, error)

func NewURL

func NewURL(rawURL string, destination string, options ...Option) (*Download, error)

func (*Download) Download

func (d *Download) Download() error

func (*Download) Validate

func (d *Download) Validate() error

type Option

type Option func(*Download) error

func WithMD5

func WithMD5(hash string) Option

func WithRemoteMD5

func WithRemoteMD5() Option

func WithRemoteSHA1

func WithRemoteSHA1() Option

func WithSHA1

func WithSHA1(hash string) Option

func WithURL

func WithURL(u *url.URL) Option

type Validator

type Validator func() error

Jump to

Keyboard shortcuts

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