backup

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package backup provides error constructors for backup operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextDirNotFound

func ContextDirNotFound(dir string) error

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

func Create(name string, cause error) error

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

func CreateArchive(cause error) error

CreateArchive wraps an archive creation failure.

Parameters:

  • cause: the underlying error

Returns:

  • error: "create archive file: <cause>"

func CreateArchiveDir

func CreateArchiveDir(cause error) error

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

func CreateGeneric(cause error) error

CreateGeneric wraps a generic backup creation failure.

Parameters:

  • cause: the underlying OS error

Returns:

  • error: "failed to create backup: <cause>"

func Global

func Global(cause error) error

Global wraps a global backup failure.

Parameters:

  • cause: the underlying error

Returns:

  • error: "global backup: <cause>"

func InvalidBackupScope

func InvalidBackupScope(scope string) error

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

func InvalidSMBURL(url string) error

InvalidSMBURL returns an error for a malformed SMB URL.

Parameters:

  • url: the invalid SMB URL

Returns:

  • error: "invalid SMB URL: <url>"

func MountFailed

func MountFailed(source string, cause error) error

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

func Project(cause error) error

Project wraps a project backup failure.

Parameters:

  • cause: the underlying error

Returns:

  • error: "project backup: <cause>"

func SMBConfig

func SMBConfig(cause error) error

SMBConfig wraps an SMB configuration parse failure.

Parameters:

  • cause: the underlying error

Returns:

  • error: "parse SMB config: <cause>"

func SMBMissingShare

func SMBMissingShare(url string) error

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

func SourceNotFound(path string) error

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

func WriteArchive(cause error) error

WriteArchive wraps a failure to write an archive file.

Parameters:

  • cause: the underlying OS error

Returns:

  • error: "failed to write archive: <cause>"

func WriteSMB

func WriteSMB(cause error) error

WriteSMB wraps a failure to write to an SMB share.

Parameters:

  • cause: the underlying write error

Returns:

  • error: "write to SMB: <cause>"

Types

This section is empty.

Jump to

Keyboard shortcuts

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