arkfs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package arkfs implements ark.Source and ark.Sink for local filesystem directories. It is the filesystem counterpart to pkg/arkdocker.

Usage with the path convenience functions:

snap, err := arkfs.Backup(ctx, repo, "/data/myapp")
result, err := arkfs.Restore(ctx, repo, snap.ID, "/tmp/restore")

Usage with raw Source/Sink (for use with repo.Backup / repo.Restore):

src, err := arkfs.NewSource("/data/myapp")
snap, err := repo.Backup(ctx, src)

sink, err := arkfs.NewSink("/tmp/restore")
result, err := repo.Restore(ctx, snap.ID, sink)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backup

func Backup(ctx context.Context, repo *ark.Repository, path string, opts ...ark.BackupOption) (*ark.Snapshot, error)

Backup stores the directory tree rooted at path as a new snapshot in repo. It is NewSource plus repo.Backup, which is all the convenience a path needs.

func NewSink

func NewSink(root string) (ark.Sink, error)

NewSink creates an ark.Sink that writes restored entries under root. The directory is created (along with parents) when Open is called.

func NewSource

func NewSource(root string) (ark.Source, error)

NewSource creates an ark.Source that walks the directory tree rooted at root. The directory must exist.

func Restore

func Restore(
	ctx context.Context,
	repo *ark.Repository,
	id, destPath string,
	opts ...ark.RestoreOption,
) (*ark.RestoreResult, error)

Restore writes the snapshot to destPath on the local filesystem. id is a full snapshot id or a unique prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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