progress

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventEmitter

type EventEmitter func(eventType string, data interface{})

EventEmitter is a function type for emitting events to the frontend

type JobProgress

type JobProgress interface {
	AddProgress(id uuid.UUID, name string, pType ProgressType, total int64) Progress
	FinishProgress(id uuid.UUID)
	GetProgress(id uuid.UUID) Progress
	GetAllProgress() map[uuid.UUID]Progress
	GetAllProgressState() []ProgressState
	GetJobID() string
	Close()
	SetAllPaused(paused bool)
}

func NewProgressJob

func NewProgressJob(jobID string) JobProgress

type Progress

type Progress interface {
	UpdateProgress(processed int64)
	Finish()
	GetState() ProgressState
	GetID() uuid.UUID
	GetName() string
	GetType() ProgressType
	GetCurrent() int64
	GetTotal() int64
	GetPercentage() float64
	IsComplete() bool
	GetStartTime() time.Time
	GetElapsedTime() time.Duration
	SetPaused(paused bool)
	IsPaused() bool
}

Progress represents an individual progress indicator

type ProgressState

type ProgressState struct {
	Max            int64
	CurrentNum     int64
	CurrentPercent float64
	CurrentBytes   float64
	SecondsSince   float64
	SecondsLeft    float64
	KBsPerSecond   float64
	Description    string
	Type           ProgressType
	IsStarted      bool
	IsPaused       bool
}

type ProgressType

type ProgressType string
const (
	ProgressTypeUploading      ProgressType = "uploading"
	ProgressTypePar2Generation ProgressType = "par2_generation"
	ProgressTypeChecking       ProgressType = "checking"
)

Jump to

Keyboard shortcuts

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