progress

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const NoBookToDownload = -1

Variables

View Source
var (
	ErrStartBookID       = errors.New("the start book id should start from 1")
	ErrStartAndEndBookID = errors.New("start book id should below the available book id")
	ErrStorageFile       = errors.New("couldn't create file for storing download process")
)

Functions

This section is empty.

Types

type Progress

type Progress interface {
	// TakeRateLimit would wait until the rate limit is available.
	TakeRateLimit()

	// AcquireBookID would find the book id from the assign array.
	AcquireBookID() int64

	// SaveBookID would save the download progress.
	SaveBookID(bookID int64) error

	// Finished would tell the called whether all the books have downloaded.
	Finished() bool

	// Size would return the book size.
	Size() int64
}

func NewProgress

func NewProgress(start, size int64, rate int, path string) (Progress, error)

NewProgress Create a storage for save the download progress.

Jump to

Keyboard shortcuts

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