processor

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: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

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

func New

func New(opts ProcessorOptions) *Processor

func (*Processor) CancelJob

func (p *Processor) CancelJob(jobID string) error

CancelJob cancels a running job by its ID

func (*Processor) Close added in v0.0.16

func (p *Processor) Close() error

func (*Processor) GetAutoPauseReason added in v0.0.20

func (p *Processor) GetAutoPauseReason() string

GetAutoPauseReason returns the reason for automatic pause, if any

func (*Processor) GetRunningJobDetails

func (p *Processor) GetRunningJobDetails() map[string]RunningJobDetails

GetRunningJobDetails returns detailed information about currently running jobs

func (*Processor) GetRunningJobItems

func (p *Processor) GetRunningJobItems() []RunningJobItem

GetRunningJobItems returns detailed information about currently running jobs

func (*Processor) GetRunningJobs

func (p *Processor) GetRunningJobs() map[string]bool

GetRunningJobs returns a map of currently running job IDs

func (*Processor) IsAutoPaused added in v0.0.20

func (p *Processor) IsAutoPaused() bool

IsAutoPaused returns true if the processor was automatically paused due to provider unavailability

func (*Processor) IsPathBeingProcessed

func (p *Processor) IsPathBeingProcessed(path string) bool

IsPathBeingProcessed checks if a file path is currently being processed

func (*Processor) IsPaused added in v0.0.14

func (p *Processor) IsPaused() bool

IsPaused returns whether the processor is currently paused

func (*Processor) PauseProcessing added in v0.0.14

func (p *Processor) PauseProcessing()

PauseProcessing pauses the processor, preventing new jobs from starting and pausing active jobs

func (*Processor) ResumeProcessing added in v0.0.14

func (p *Processor) ResumeProcessing()

ResumeProcessing resumes the processor, allowing new jobs to start and resuming active jobs

func (*Processor) Start

func (p *Processor) Start(ctx context.Context) error

Start begins processing files from the queue

type ProcessorOptions

type ProcessorOptions struct {
	Queue                     *queue.Queue
	Config                    config.Config
	QueueConfig               config.QueueConfig
	PoolManager               *pool.Manager
	OutputFolder              string
	DeleteOriginalFile        bool
	MaintainOriginalExtension bool
	WatchFolder               string
	CanProcessNextItem        func() bool // Callback to check if processor can start new items
}

type RunningJob added in v0.0.13

type RunningJob struct {
	RunningJobDetails
	Progress progress.JobProgress
	// contains filtered or unexported fields
}

type RunningJobDetails

type RunningJobDetails struct {
	ID       string                   `json:"id"`
	Path     string                   `json:"path"`
	FileName string                   `json:"fileName"`
	Size     int64                    `json:"size"`
	Progress []progress.ProgressState `json:"progress"`
}

type RunningJobItem

type RunningJobItem struct {
	ID string `json:"id"`
}

RunningJobItem represents a running job for the frontend (kept for backward compatibility)

Jump to

Keyboard shortcuts

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