Documentation
¶
Index ¶
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
CanExtract checks if the file is a 7z archive
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
NewCLIUnrar creates a new UnRAR extractor using the system's unrar binary. Returns an error if the unrar binary is not found in PATH.
func (*CLIUnrar) CanExtract ¶ added in v0.4.0
CanExtract checks if the file is a RAR archive by verifying: 1. File extension (.rar) 2. Magic bytes (file signature) 3. For multi-part archives, only extract the first part
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) ([]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 []*nzb.DownloadFile) (map[*nzb.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
PostProcess handles the modular repair and extraction logic
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