Documentation
¶
Overview ¶
Package backup provides error constructors for backup operations.
Index ¶
- func ContextDirNotFound(dir string) error
- func Create(name string, cause error) error
- func CreateArchive(cause error) error
- func CreateArchiveDir(cause error) error
- func CreateGeneric(cause error) error
- func Global(cause error) error
- func InvalidBackupScope(scope string) error
- func InvalidSMBURL(url string) error
- func MountFailed(source string, cause error) error
- func Project(cause error) error
- func SMBConfig(cause error) error
- func SMBMissingShare(url string) error
- func SourceNotFound(path string) error
- func WriteArchive(cause error) error
- func WriteSMB(cause error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextDirNotFound ¶
ContextDirNotFound returns an error when the context directory does not exist.
Parameters:
- dir: the missing context directory path.
Returns:
- error: "context directory not found: <dir>: run 'ctx init'"
func Create ¶
Create wraps a failure to create a backup file.
Parameters:
- name: backup filename that could not be created
- cause: the underlying OS error
Returns:
- error: "failed to create backup <name>: <cause>"
func CreateArchive ¶
CreateArchive wraps an archive creation failure.
Parameters:
- cause: the underlying error
Returns:
- error: "create archive file: <cause>"
func CreateArchiveDir ¶
CreateArchiveDir wraps a failure to create the archive directory.
Parameters:
- cause: the underlying OS error
Returns:
- error: "failed to create archive directory: <cause>"
func CreateGeneric ¶
CreateGeneric wraps a generic backup creation failure.
Parameters:
- cause: the underlying OS error
Returns:
- error: "failed to create backup: <cause>"
func Global ¶
Global wraps a global backup failure.
Parameters:
- cause: the underlying error
Returns:
- error: "global backup: <cause>"
func InvalidBackupScope ¶
InvalidBackupScope returns an error for an unrecognized backup scope value.
Parameters:
- scope: the invalid scope string
Returns:
- error: "invalid scope '<scope>': must be project, global, or all"
func InvalidSMBURL ¶
InvalidSMBURL returns an error for a malformed SMB URL.
Parameters:
- url: the invalid SMB URL
Returns:
- error: "invalid SMB URL: <url>"
func MountFailed ¶
MountFailed wraps a failure to mount an SMB share.
Parameters:
- source: the SMB source URL
- cause: the underlying mount error
Returns:
- error: "failed to mount <source>: <cause>"
func Project ¶
Project wraps a project backup failure.
Parameters:
- cause: the underlying error
Returns:
- error: "project backup: <cause>"
func SMBConfig ¶
SMBConfig wraps an SMB configuration parse failure.
Parameters:
- cause: the underlying error
Returns:
- error: "parse SMB config: <cause>"
func SMBMissingShare ¶
SMBMissingShare returns an error when an SMB URL has no share name.
Parameters:
- url: the SMB URL missing a share name
Returns:
- error: "SMB URL missing share name: <url>"
func SourceNotFound ¶
SourceNotFound returns an error when a backup source path is missing.
Parameters:
- path: the missing source path
Returns:
- error: "source not found: <path>"
func WriteArchive ¶
WriteArchive wraps a failure to write an archive file.
Parameters:
- cause: the underlying OS error
Returns:
- error: "failed to write archive: <cause>"
Types ¶
This section is empty.