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 ¶
NewSink creates an ark.Sink that writes restored entries under root. The directory is created (along with parents) when Open is called.
func NewSource ¶
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.