Documentation ¶
Overview ¶
Package kopiarunner wraps the execution of the kopia binary.
Index ¶
- Variables
- type KopiaSnapshotter
- func (ks *KopiaSnapshotter) Cleanup()
- func (ks *KopiaSnapshotter) ConnectOrCreateFilesystem(repoPath string) error
- func (ks *KopiaSnapshotter) ConnectOrCreateRepo(args ...string) error
- func (ks *KopiaSnapshotter) ConnectOrCreateS3(bucketName, pathPrefix string) error
- func (ks *KopiaSnapshotter) ConnectRepo(args ...string) (err error)
- func (ks *KopiaSnapshotter) CreateRepo(args ...string) (err error)
- func (ks *KopiaSnapshotter) CreateSnapshot(source string) (snapID string, err error)
- func (ks *KopiaSnapshotter) DeleteSnapshot(snapID string) (err error)
- func (ks *KopiaSnapshotter) ListSnapshots() ([]string, error)
- func (ks *KopiaSnapshotter) RestoreSnapshot(snapID, restoreDir string) (err error)
- func (ks *KopiaSnapshotter) Run(args ...string) (stdout, stderr string, err error)
- func (ks *KopiaSnapshotter) RunGC() (err error)
- type Runner
Constants ¶
This section is empty.
Variables ¶
var ErrExeVariableNotSet = errors.New("KOPIA_EXE variable has not been set")
ErrExeVariableNotSet is an exported error.
Functions ¶
This section is empty.
Types ¶
type KopiaSnapshotter ¶
type KopiaSnapshotter struct {
Runner *Runner
}
KopiaSnapshotter implements the Snapshotter interface using Kopia commands.
func NewKopiaSnapshotter ¶
func NewKopiaSnapshotter(baseDir string) (*KopiaSnapshotter, error)
NewKopiaSnapshotter instantiates a new KopiaSnapshotter and returns its pointer.
func (*KopiaSnapshotter) Cleanup ¶
func (ks *KopiaSnapshotter) Cleanup()
Cleanup cleans up the kopia Runner.
func (*KopiaSnapshotter) ConnectOrCreateFilesystem ¶
func (ks *KopiaSnapshotter) ConnectOrCreateFilesystem(repoPath string) error
ConnectOrCreateFilesystem attempts to connect to a kopia repo in the local filesystem at the path provided. It will attempt to create one there if connection was unsuccessful.
func (*KopiaSnapshotter) ConnectOrCreateRepo ¶
func (ks *KopiaSnapshotter) ConnectOrCreateRepo(args ...string) error
ConnectOrCreateRepo attempts to connect to a repo described by the provided arguments, and attempts to create it if connection was unsuccessful.
func (*KopiaSnapshotter) ConnectOrCreateS3 ¶
func (ks *KopiaSnapshotter) ConnectOrCreateS3(bucketName, pathPrefix string) error
ConnectOrCreateS3 attempts to connect to a kopia repo in the s3 bucket identified by the provided bucketName, at the provided path prefix. It will attempt to create one there if connection was unsuccessful.
func (*KopiaSnapshotter) ConnectRepo ¶
func (ks *KopiaSnapshotter) ConnectRepo(args ...string) (err error)
ConnectRepo connects to the repository described by the provided arguments.
func (*KopiaSnapshotter) CreateRepo ¶
func (ks *KopiaSnapshotter) CreateRepo(args ...string) (err error)
CreateRepo creates a kopia repository with the provided arguments.
func (*KopiaSnapshotter) CreateSnapshot ¶
func (ks *KopiaSnapshotter) CreateSnapshot(source string) (snapID string, err error)
CreateSnapshot implements the Snapshotter interface, issues a kopia snapshot create command on the provided source path.
func (*KopiaSnapshotter) DeleteSnapshot ¶
func (ks *KopiaSnapshotter) DeleteSnapshot(snapID string) (err error)
DeleteSnapshot implements the Snapshotter interface, issues a kopia snapshot delete of the provided snapshot ID.
func (*KopiaSnapshotter) ListSnapshots ¶
func (ks *KopiaSnapshotter) ListSnapshots() ([]string, error)
ListSnapshots implements the Snapshotter interface, issues a kopia snapshot list and parses the snapshot IDs.
func (*KopiaSnapshotter) RestoreSnapshot ¶
func (ks *KopiaSnapshotter) RestoreSnapshot(snapID, restoreDir string) (err error)
RestoreSnapshot implements the Snapshotter interface, issues a kopia snapshot restore command of the provided snapshot ID to the provided restore destination.
func (*KopiaSnapshotter) Run ¶
func (ks *KopiaSnapshotter) Run(args ...string) (stdout, stderr string, err error)
Run implements the Snapshotter interface, issues an arbitrary kopia command and returns the output.
func (*KopiaSnapshotter) RunGC ¶ added in v0.7.0
func (ks *KopiaSnapshotter) RunGC() (err error)
RunGC implements the Snapshotter interface, issues a gc command to the kopia repo.