par2

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPar2File

func IsPar2File(path string) bool

IsPar2File returns true if the given path matches a PAR2 file pattern.

Types

type BinaryExecutor added in v0.0.29

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

BinaryExecutor implements Par2Executor by shelling out to an external parpar binary.

func NewBinaryExecutor added in v0.0.29

func NewBinaryExecutor(articleSize uint64, cfg *config.Par2Config, jobProgress progress.JobProgress) *BinaryExecutor

NewBinaryExecutor creates a new BinaryExecutor.

func (*BinaryExecutor) Create added in v0.0.29

func (b *BinaryExecutor) Create(ctx context.Context, files []fileinfo.FileInfo) ([]string, error)

Create creates PAR2 parity files using the parpar binary.

func (*BinaryExecutor) CreateInDirectory added in v0.0.29

func (b *BinaryExecutor) CreateInDirectory(ctx context.Context, files []fileinfo.FileInfo, outputDir string) ([]string, error)

CreateInDirectory creates PAR2 files in the specified output directory using the parpar binary.

type NativeExecutor added in v0.0.29

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

NativeExecutor implements Par2Executor using the built-in Go PAR2 creator.

func New

func New(articleSize uint64, cfg *config.Par2Config, jobProgress progress.JobProgress) *NativeExecutor

New creates a new NativeExecutor.

func (*NativeExecutor) Create added in v0.0.29

func (p *NativeExecutor) Create(ctx context.Context, files []fileinfo.FileInfo) ([]string, error)

Create creates PAR2 parity files for the given input files.

func (*NativeExecutor) CreateInDirectory added in v0.0.29

func (p *NativeExecutor) CreateInDirectory(ctx context.Context, files []fileinfo.FileInfo, outputDir string) ([]string, error)

CreateInDirectory creates PAR2 files with optional output directory specification.

type Par2Executor

type Par2Executor interface {
	Create(ctx context.Context, files []fileinfo.FileInfo) ([]string, error)
	CreateInDirectory(ctx context.Context, files []fileinfo.FileInfo, outputDir string) ([]string, error)
}

Par2Executor defines the interface for executing par2 commands.

func NewExecutor added in v0.0.29

func NewExecutor(articleSize uint64, cfg *config.Par2Config, jobProgress progress.JobProgress) Par2Executor

NewExecutor returns the appropriate Par2Executor based on config. If cfg.ParparBinaryPath is non-empty, returns a BinaryExecutor; otherwise NativeExecutor.

Jump to

Keyboard shortcuts

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