downloader

package
v0.0.0-...-850ae45 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	DownloadOVA(startAtByte int64) (ova *pivnet.DownloadReader, err error)
}

type ConcreteOVADownloader

type ConcreteOVADownloader struct {
	FS                   FS
	PivnetClient         Client
	Config               *config.Config
	Token                Token
	DownloadAttempts     int
	DownloadAttemptDelay time.Duration
}

func (*ConcreteOVADownloader) Download

func (d *ConcreteOVADownloader) Download() (string, error)

func (*ConcreteOVADownloader) IsOVACurrent

func (d *ConcreteOVADownloader) IsOVACurrent() (bool, error)

func (*ConcreteOVADownloader) Setup

func (d *ConcreteOVADownloader) Setup() error

type Downloader

type Downloader interface {
	IsOVACurrent() (current bool, err error)
	Download() error
}

type DownloaderFactory

type DownloaderFactory struct {
	FS                   FS
	Config               *config.Config
	PivnetClient         Client
	Token                Token
	DownloadAttempts     int
	DownloadAttemptDelay time.Duration
}

func (*DownloaderFactory) Create

func (f *DownloaderFactory) Create() (Downloader, error)

type FS

type FS interface {
	Remove(path string) error
	Exists(path string) (exists bool, err error)
	MD5(path string) (md5 string, err error)
	CreateDir(path string) error
	Length(path string) (bytes int64, err error)
	Write(path string, contents io.Reader, append bool) error
	Move(source string, destinationPath string) error
	DeleteAllExcept(path string, filenames []string) error
}

type FullDownloader

type FullDownloader struct {
	Downloader OVADownloader
	FS         FS
	Config     *config.Config
}

func (*FullDownloader) Download

func (f *FullDownloader) Download() error

func (*FullDownloader) IsOVACurrent

func (f *FullDownloader) IsOVACurrent() (bool, error)

type OVADownloader

type OVADownloader interface {
	Setup() error
	Download() (md5 string, err error)
	IsOVACurrent() (current bool, err error)
}

type PartialDownloader

type PartialDownloader struct {
	Downloader OVADownloader
	FS         FS
	Config     *config.Config
}

func (*PartialDownloader) Download

func (p *PartialDownloader) Download() error

func (*PartialDownloader) IsOVACurrent

func (p *PartialDownloader) IsOVACurrent() (bool, error)

type Token

type Token interface {
	Save() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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