execrestic

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package execrestic provides a restic client adapter using exec.Command.

Index

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 New

func New(opts ...Option) *ExecResticClient

New creates a new ExecResticClient adapter.

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.

func (*ExecResticClient) Snapshots

func (r *ExecResticClient) Snapshots(repoPath, password string, tags []string) ([]ports.Snapshot, error)

Snapshots returns all snapshots in the repository.

type Option

type Option func(*ExecResticClient)

Option is a functional option for configuring ExecResticClient.

func WithResticPath

func WithResticPath(path string) Option

WithResticPath sets a custom path to the restic binary.

Jump to

Keyboard shortcuts

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