Documentation
¶
Index ¶
- type CLI7z
- type CLIPar2
- type CLIUnrar
- type CLIUnzip
- type Closeable
- type CmdFactory
- type Extractor
- type Manager
- type Processor
- func (p *Processor) Finalize(ctx context.Context, tasks []*domain.DownloadFile) error
- func (p *Processor) PostProcess(ctx context.Context, item *domain.QueueItem, tasks []*domain.DownloadFile) error
- func (p *Processor) Prepare(ctx context.Context, item *domain.QueueItem, nzbModel *nzb.Model, ...) (*domain.PreparationResult, error)
- type Repairer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI7z ¶ added in v0.4.0
type CLI7z struct {
BinaryPath string
}
func (*CLI7z) CanExtract ¶ added in v0.4.0
type CLIPar2 ¶ added in v0.4.0
type CLIPar2 struct {
BinaryPath string
}
func NewCLIPar2 ¶ added in v0.4.0
type CLIUnrar ¶ added in v0.4.0
type CLIUnrar struct {
BinaryPath string
}
func NewCLIUnrar ¶ added in v0.4.0
func (*CLIUnrar) CanExtract ¶ added in v0.4.0
type CLIUnzip ¶ added in v0.4.0
type CLIUnzip struct {
BinaryPath string
}
func NewCLIUnzip ¶ added in v0.4.0
func (*CLIUnzip) CanExtract ¶ added in v0.4.0
CanExtract checks if the file is a ZIP archive
type CmdFactory ¶ added in v0.4.0
type Extractor ¶ added in v0.4.0
type Extractor interface {
// Extract extracts the archive at the given path to the destination directory.
// Returns the list of extracted file paths, or an error if extration fails.
Extract(ctx context.Context, archivePath string, destDir string, password string) ([]string, error)
// CanExtract checks if this extractor can handle the given file.
CanExtract(filename string) (bool, error)
// Returns the human-readable name of this extractor (e.g. "RAR", "ZIP")
Name() string
}
Extractor defines the behavior for extracting compress archives
type Manager ¶ added in v0.4.0
type Manager struct {
// contains filtered or unexported fields
}
Manager handles multiple extractors and determines which to use
func NewManager ¶ added in v0.4.0
func NewManager() *Manager
NewManager creates a new extraction manager and initilizes available extractors
func (*Manager) AvailableExtractors ¶ added in v0.4.0
AvailableExtractors returns the names of available extractors
func (*Manager) DetectArchives ¶ added in v0.4.0
func (m *Manager) DetectArchives(tasks []*domain.DownloadFile) (map[*domain.DownloadFile]Extractor, error)
DetectArchives scans the completed tasks and returns archives that need extraction Returns a map of task -> extractor for each archive found
func (*Manager) HasExtractors ¶ added in v0.4.0
HasExtractors returns true if any extractors are available
type Processor ¶ added in v0.4.0
type Processor struct {
// contains filtered or unexported fields
}
func (*Processor) PostProcess ¶ added in v0.4.0
func (p *Processor) PostProcess(ctx context.Context, item *domain.QueueItem, tasks []*domain.DownloadFile) error
CHANGED: PostProcess now receives the queue item and preserves per-job completed layout.
type Repairer ¶ added in v0.4.0
type Repairer interface {
// Verify checks if the file in the directory are healthy.
// Returns true if healthy, false if repair is needed.
Verify(path string) (bool, error)
// Repair attempts to fix the files using available parity volumes.
Repair(path string) error
}
Repairer defines the behavior for verifying and fixing downloads