Documentation
¶
Overview ¶
Package execrestic provides a restic client adapter using exec.Command.
Index ¶
- type ExecResticClient
- func (r *ExecResticClient) Backup(repoPath, password string, paths []string, tags []string) (string, error)
- func (r *ExecResticClient) Forget(repoPath, password string, keepLast int, prune bool) error
- func (r *ExecResticClient) Init(repoPath, password string) error
- func (r *ExecResticClient) IsInitialized(repoPath string) bool
- func (r *ExecResticClient) Restore(repoPath, password, snapshotID, targetDir string) error
- func (r *ExecResticClient) Snapshots(repoPath, password string, tags []string) ([]ports.Snapshot, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecResticClient ¶
type ExecResticClient struct {
// contains filtered or unexported fields
}
ExecResticClient implements ports.ResticClient using exec.Command.
func (*ExecResticClient) Backup ¶
func (r *ExecResticClient) Backup(repoPath, password string, paths []string, tags []string) (string, error)
Backup creates a new backup of the given paths to the repository.
func (*ExecResticClient) Forget ¶
func (r *ExecResticClient) Forget(repoPath, password string, keepLast int, prune bool) error
Forget removes old snapshots according to the retention policy.
func (*ExecResticClient) Init ¶
func (r *ExecResticClient) Init(repoPath, password string) error
Init initializes a new restic repository at the given path.
func (*ExecResticClient) IsInitialized ¶
func (r *ExecResticClient) IsInitialized(repoPath string) bool
IsInitialized checks if a restic repository exists at the given path.
func (*ExecResticClient) Restore ¶
func (r *ExecResticClient) Restore(repoPath, password, snapshotID, targetDir string) error
Restore restores a snapshot to the given target directory.
type Option ¶
type Option func(*ExecResticClient)
Option is a functional option for configuring ExecResticClient.
func WithResticPath ¶
WithResticPath sets a custom path to the restic binary.
Click to show internal directories.
Click to hide internal directories.