Documentation
¶
Index ¶
Constants ¶
View Source
const ( ExitCodeSuccess int = 0 ExitCodePartialFailure int = 1 // ErrExitPartialFailure ExitCodeBadInvocation int = 2 // ErrExitBadInvocation ExitCodeRepairable int = 3 // ErrExitRepairable ExitCodeUnrepairable int = 4 // ErrExitUnrepairable ExitCodeUnclassified int = 5 // ErrExitUnclassified Par2ExitCodeSuccess int = 0 Par2ExitCodeRepairPossible int = 1 Par2ExitCodeRepairImpossible int = 2 Par2Extension string = ".par2" // used as par2Extension LockExtension string = ".lock" // used as par2Extension+lockExtension ManifestExtension string = ".json" // used as par2Extension+manifestExtension IgnoreFile string = ".par2cron-ignore" IgnoreAllFile string = ".par2cron-ignore-all" CreateFileMode string = "file" CreateFolderMode string = "folder" CreateRecursiveMode string = "recursive" )
View Source
const ( PosKey ctxKey = iota MposKey ctxKey = iota PrioKey ctxKey = iota )
View Source
const (
ManifestVersion = "2"
)
Variables ¶
View Source
var ( ErrExitPartialFailure = errors.New("partial failure") // [ExitCodePartialFailure] ErrExitBadInvocation = errors.New("bad invocation") // [ExitCodeBadInvocation] ErrExitRepairable = errors.New("files are corrupted, but repairable") // [ExitCodeRepairable] ErrExitUnrepairable = errors.New("files are corrupted, but unrepairable") // [ExitCodeUnrepairable] ErrExitUnclassified = errors.New("unclassified error") // [ExitCodeUnclassified] ErrAlreadyExists = errors.New("file exists") ErrFileIsLocked = errors.New("file is locked") ErrNonFatal = errors.New("non-fatal error") ErrSilentSkip = errors.New("skip without error") ErrManifestMismatch = errors.New("manifest mismatch") )
View Source
var ProgramVersion = "devel"
ProgramVersion is the program version as filled in by the Makefile.
Functions ¶
func ExitCodeFor ¶
Types ¶
type CommandRunner ¶
type CreationManifest ¶
type CreationManifest struct {
Time time.Time `json:"time"`
Args []string `json:"args"`
Duration time.Duration `json:"duration_ns"`
Elements []FsElement `json:"elements"`
}
func (*CreationManifest) UnmarshalJSON ¶ added in v0.1.5
func (c *CreationManifest) UnmarshalJSON(data []byte) error
type FilesystemWalker ¶
type FilesystemWalker interface {
WalkDir(root string, fn fs.WalkDirFunc) error
}
FilesystemWalker is an interface describing a filesystem walking function.
type Manifest ¶
type Manifest struct {
ProgramVersion string `json:"program_version"`
ManifestVersion string `json:"manifest_version"`
Name string `json:"name"`
SHA256 string `json:"sha256"`
Par2Data *Par2DataManifest `json:"par2_data,omitempty"`
Creation *CreationManifest `json:"creation,omitempty"`
Verification *VerificationManifest `json:"verification,omitempty"`
Repair *RepairManifest `json:"repair,omitempty"`
}
func NewManifest ¶
type Par2DataManifest ¶ added in v0.1.5
type RepairManifest ¶
type VerificationManifest ¶
type VerificationManifest struct {
Count int `json:"count"`
CountCorrupted int `json:"count_corrupted"`
Time time.Time `json:"time"`
Args []string `json:"args"`
ExitCode int `json:"exit_code"`
RepairNeeded bool `json:"repair_needed"`
RepairPossible bool `json:"repair_possible"`
Duration time.Duration `json:"duration_ns"`
}
Click to show internal directories.
Click to hide internal directories.