progress

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: GPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadProgressBar added in v1.1.0

type DownloadProgressBar struct {
	// contains filtered or unexported fields
}

func NewDlProgressBar added in v1.1.0

func NewDlProgressBar(ctx context.Context, messages Messages) *DownloadProgressBar

func (*DownloadProgressBar) GetDownloadETA added in v1.1.0

func (dlP *DownloadProgressBar) GetDownloadETA() float64

func (*DownloadProgressBar) GetDownloadSpeed added in v1.1.0

func (dlP *DownloadProgressBar) GetDownloadSpeed() float64

func (*DownloadProgressBar) GetErrMsg added in v1.1.0

func (dlP *DownloadProgressBar) GetErrMsg() string

func (*DownloadProgressBar) GetFilename added in v1.1.0

func (dlP *DownloadProgressBar) GetFilename() string

func (*DownloadProgressBar) GetMsg added in v1.1.0

func (dlP *DownloadProgressBar) GetMsg() string

func (*DownloadProgressBar) GetPercentage added in v1.1.0

func (dlP *DownloadProgressBar) GetPercentage() int

func (*DownloadProgressBar) GetSuccessMsg added in v1.1.0

func (dlP *DownloadProgressBar) GetSuccessMsg() string

func (*DownloadProgressBar) GetTotalBytes added in v1.1.0

func (dlP *DownloadProgressBar) GetTotalBytes() int64

func (*DownloadProgressBar) HasError added in v1.1.0

func (dlP *DownloadProgressBar) HasError() bool

func (*DownloadProgressBar) IsFinished added in v1.1.0

func (dlP *DownloadProgressBar) IsFinished() bool

func (*DownloadProgressBar) Stop added in v1.1.0

func (dlP *DownloadProgressBar) Stop(err bool)

func (*DownloadProgressBar) UpdateDownloadETA added in v1.1.0

func (dlP *DownloadProgressBar) UpdateDownloadETA(eta float64)

func (*DownloadProgressBar) UpdateDownloadSpeed added in v1.1.0

func (dlP *DownloadProgressBar) UpdateDownloadSpeed(speed float64)

func (*DownloadProgressBar) UpdateErrMsg added in v1.1.0

func (dlP *DownloadProgressBar) UpdateErrMsg(errMsg string)

func (*DownloadProgressBar) UpdateFilename added in v1.1.0

func (dlP *DownloadProgressBar) UpdateFilename(filename string)

func (*DownloadProgressBar) UpdateMsg added in v1.1.0

func (dlP *DownloadProgressBar) UpdateMsg(msg string)

func (*DownloadProgressBar) UpdatePercentage added in v1.1.0

func (dlP *DownloadProgressBar) UpdatePercentage(percentage int)

func (*DownloadProgressBar) UpdateSuccessMsg added in v1.1.0

func (dlP *DownloadProgressBar) UpdateSuccessMsg(successMsg string)

func (*DownloadProgressBar) UpdateTotalBytes added in v1.1.0

func (dlP *DownloadProgressBar) UpdateTotalBytes(bytes int64)

type DummyProgBar added in v1.1.0

type DummyProgBar struct{}

DummyProgBar is a dummy implementation of the ProgressBar interface for testing purposes

func (*DummyProgBar) Add added in v1.1.0

func (tpb *DummyProgBar) Add(int)

func (*DummyProgBar) GetIsProgBar added in v1.1.0

func (tpb *DummyProgBar) GetIsProgBar() bool

func (*DummyProgBar) GetIsSpinner added in v1.1.0

func (tpb *DummyProgBar) GetIsSpinner() bool

func (*DummyProgBar) Increment added in v1.1.0

func (tpb *DummyProgBar) Increment()

func (*DummyProgBar) MakeLatestSnapshotMain added in v1.1.0

func (tpb *DummyProgBar) MakeLatestSnapshotMain()

func (*DummyProgBar) SetToProgressBar added in v1.1.0

func (tpb *DummyProgBar) SetToProgressBar()

func (*DummyProgBar) SetToSpinner added in v1.1.0

func (tpb *DummyProgBar) SetToSpinner()

func (*DummyProgBar) SnapshotTask added in v1.1.0

func (tpb *DummyProgBar) SnapshotTask()

func (*DummyProgBar) Start added in v1.1.0

func (tpb *DummyProgBar) Start()

func (*DummyProgBar) Stop added in v1.1.0

func (tpb *DummyProgBar) Stop(bool)

func (*DummyProgBar) StopInterrupt added in v1.1.0

func (tpb *DummyProgBar) StopInterrupt(string)

func (*DummyProgBar) UpdateBaseMsg added in v1.1.0

func (tpb *DummyProgBar) UpdateBaseMsg(string)

func (*DummyProgBar) UpdateErrorMsg added in v1.1.0

func (tpb *DummyProgBar) UpdateErrorMsg(string)

func (*DummyProgBar) UpdateMax added in v1.1.0

func (tpb *DummyProgBar) UpdateMax(int)

func (*DummyProgBar) UpdateSuccessMsg added in v1.1.0

func (tpb *DummyProgBar) UpdateSuccessMsg(string)

type Messages added in v1.1.0

type Messages struct {
	Msg        string
	SuccessMsg string
	ErrMsg     string
}

type ProgressBar added in v1.1.0

type ProgressBar interface {
	// Add adds the given number to the progress.
	Add(int)

	// Start starts the progress.
	Start()

	// Stop stops the progress.
	// Requires a bool to indicate if there is an error or not after the progress is stopped.
	Stop(bool)

	// Change to spinner, meaning there is no clear indicator of the progress.
	SetToSpinner()
	GetIsSpinner() bool

	// Change to progress bar, meaning there is a clear indicator of the progress.
	SetToProgressBar()
	GetIsProgBar() bool

	// Stops the progress due to an interrupt signal.
	StopInterrupt(string)

	// UpdateBaseMsg updates the base message of the progress.
	UpdateBaseMsg(string)

	// UpdateMax updates the maximum value of the progress.
	UpdateMax(int)

	// Increment increments the progress by 1.
	Increment()

	// Updates the success message of the progress.
	UpdateSuccessMsg(string)

	// Updates the message of the progress in the event of an error.
	UpdateErrorMsg(string)

	// Mainly for frontend usage.
	SnapshotTask()           // Saves the current progress state for nested progress bars.
	MakeLatestSnapshotMain() // Makes the latest snapshot the main progress bar.
}

type ProgressBarInfo added in v1.1.0

type ProgressBarInfo struct {
	MainProgressBar      ProgressBar
	DownloadProgressBars *[]*DownloadProgressBar
	// contains filtered or unexported fields
}

func (*ProgressBarInfo) AppendDlProgBar added in v1.1.0

func (pgi *ProgressBarInfo) AppendDlProgBar(progBar *DownloadProgressBar)

type ProgressDetails added in v1.1.0

type ProgressDetails struct {
	Title        string
	MainUrl      string
	ThumbnailUrl string
	FolderPath   string
}

Jump to

Keyboard shortcuts

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