par2

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPar2File

func IsPar2File(path string) bool

Types

type Par2CmdExecutor

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

Par2CmdExecutor implements Par2Executor using the command line.

func New

func New(ctx context.Context, articleSize uint64, cfg *config.Par2Config) *Par2CmdExecutor

func (*Par2CmdExecutor) Create

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

Repair executes the par2 command to repair files in the target folder.

func (*Par2CmdExecutor) SetProgressCallback added in v0.0.6

func (p *Par2CmdExecutor) SetProgressCallback(callback ProgressCallback)

SetProgressCallback sets the progress callback function

type Par2Executor

type Par2Executor interface {
	Create(ctx context.Context, tmpPath string) ([]string, error)
	SetProgressCallback(callback ProgressCallback)
}

Par2Executor defines the interface for executing par2 commands.

type ProgressCallback added in v0.0.6

type ProgressCallback func(stage string, current, total int64, details string, speed float64, secondsLeft float64, elapsedTime float64)

ProgressCallback defines the interface for PAR2 progress notifications

Jump to

Keyboard shortcuts

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