Versions in this module Expand all Collapse all v1 v1.0.1 Nov 7, 2026retracted v1.0.0 Oct 28, 2026retracted v0 v0.3.0 Nov 8, 2026 Changes in this version + var ErrCorruptConfig = errors.New("ark: repository config does not match its master key") v0.2.0 Nov 8, 2026 Changes in this version type Backend + Sync func(ctx context.Context) error type CheckResult + Warnings []string + type ConcurrentSource interface + ConcurrentOpen func() bool type FileInfo + ChangeTime time.Time + Inode uint64 type HandleType + const MarkerFile type SnapshotStats + FilesUnchanged int v0.1.0 Nov 7, 2026 Changes in this version + const UnknownNamespace + var ErrAlreadyInitialized = errors.New("ark: repository is already initialized") + var ErrAmbiguousID = errors.New("ark: snapshot id prefix is ambiguous") + var ErrCorruptChunk = errors.New("ark: corrupt chunk") + var ErrCorruptManifest = errors.New("ark: corrupt snapshot manifest") + var ErrCorruptTree = errors.New("ark: corrupt snapshot tree") + var ErrEmptyPolicy = errors.New("ark: forget policy keeps nothing and no ids given") + var ErrIncompatibleSourceType = errors.New("ark: incompatible source type") + var ErrMissingChunk = errors.New("ark: missing chunk") + var ErrNotFound = errors.New("ark: snapshot not found") + var ErrNotInitialized = errors.New("ark: repository is not initialized") + var ErrNotPasswordProtected = errors.New("ark: repository is not password protected") + var ErrPasswordRequired = errors.New("ark: repository is password protected") + var ErrRepoLocked = errors.New("ark: repository is locked by another operation") + var ErrUnsupportedFormat = errors.New("ark: unsupported repository format") + var ErrWrongPassword = errors.New("ark: wrong password or no key file matches") + func Init(ctx context.Context, b Backend, pw Passphrase, opts ...InitOption) error + type Backend interface + Close func() error + Delete func(ctx context.Context, h Handle) error + Exists func(ctx context.Context, h Handle) (bool, error) + Get func(ctx context.Context, h Handle) (io.ReadCloser, error) + List func(ctx context.Context, t HandleType, fn func(BlobInfo) error) error + Put func(ctx context.Context, h Handle, r io.Reader) error + Stat func(ctx context.Context, h Handle) (BlobInfo, error) + type BackupOption func(*backupOptions) + func WithBackupProgress(fn ProgressFunc) BackupOption + func WithComment(s string) BackupOption + func WithHost(h string) BackupOption + func WithParent(id string) BackupOption + func WithTags(tags ...string) BackupOption + type BlobInfo struct + Name string + Size int64 + type CheckResult struct + Errors []string + SnapshotsChecked int + type FileInfo struct + GID int + LinkDest string + ModTime time.Time + Mode os.FileMode + Path string + Size int64 + Type FileType + UID int + Xattrs map[string][]byte + type FileType string + const FileTypeDirectory + const FileTypeHardlink + const FileTypeRegular + const FileTypeSymlink + const FileTypeUnsupported + type ForgetOption func(*forgetConfig) + func WithForgetDryRun() ForgetOption + type ForgetPolicy struct + KeepDaily int + KeepHourly int + KeepLast int + KeepMonthly int + KeepWeekly int + KeepWithin time.Duration + KeepYearly int + type ForgetResult struct + DryRun bool + Keep []*Snapshot + Remove []*Snapshot + type Handle struct + Name string + Type HandleType + type HandleType uint8 + const BlobFile + const ConfigFile + const KeyFile + const LockFile + const SnapshotFile + const TreeFile + func (t HandleType) String() string + type InitOption func(*initConfig) + func WithChunkerConfig(c chunker.Config) InitOption + type LockInfo struct + Exclusive bool + Hostname string + ID string + PID int + Stale bool + Time time.Time + Username string + type Option func(*openConfig) + func WithConcurrency(n int) Option + func WithLockWait(d time.Duration) Option + func WithLogger(l *slog.Logger) Option + type Passphrase struct + func WithPassword(password string) Passphrase + func WithoutPassword() Passphrase + func (p Passphrase) GoString() string + func (p Passphrase) String() string + type Phase string + const PhaseFetch + const PhaseFinalize + const PhaseLoad + const PhaseScan + const PhaseStore + const PhaseWrite + type ProgressEvent struct + BytesDone int64 + BytesTotal int64 + ChunksDone int + ChunksTotal int + CurrentPath string + FilesDone int + FilesTotal int + Phase Phase + type ProgressFunc func(ProgressEvent) + type PruneOption func(*pruneConfig) + func WithPruneDryRun() PruneOption + type PruneResult struct + BlobsRemoved int + BytesFreed int64 + DryRun bool + type Repository struct + func Open(ctx context.Context, b Backend, pw Passphrase, opts ...Option) (*Repository, error) + func (r *Repository) Backup(ctx context.Context, src Source, opts ...BackupOption) (*Snapshot, error) + func (r *Repository) ChangePassword(ctx context.Context, pw Passphrase) error + func (r *Repository) Check(ctx context.Context) (*CheckResult, error) + func (r *Repository) Close() error + func (r *Repository) Export(ctx context.Context, id string, w io.Writer) error + func (r *Repository) Forget(ctx context.Context, policy ForgetPolicy, filter SnapshotFilter, ...) (*ForgetResult, error) + func (r *Repository) ID() string + func (r *Repository) Import(ctx context.Context, reader io.Reader) (*Snapshot, error) + func (r *Repository) Locks(ctx context.Context) ([]LockInfo, error) + func (r *Repository) Prune(ctx context.Context, opts ...PruneOption) (*PruneResult, error) + func (r *Repository) Restore(ctx context.Context, id string, sink Sink, opts ...RestoreOption) (*RestoreResult, error) + func (r *Repository) Snapshot(ctx context.Context, id string) (*Snapshot, error) + func (r *Repository) Snapshots(ctx context.Context, filter SnapshotFilter) ([]*Snapshot, error) + func (r *Repository) Unlock(ctx context.Context, opts ...UnlockOption) (int, error) + func (r *Repository) Verify(ctx context.Context, id string) (*VerifyResult, error) + func (r *Repository) Walk(ctx context.Context, id string, fn func(FileInfo) error) error + type RestoreOption func(*restoreOptions) + func WithRestoreCache(bytes int64) RestoreOption + func WithRestorePaths(paths ...string) RestoreOption + func WithRestoreProgress(fn ProgressFunc) RestoreOption + type RestoreResult struct + BytesRestored int64 + FilesRestored int + type Sink interface + Close func() error + Open func(ctx context.Context, meta SourceMeta) error + Receive func(ctx context.Context, entry FileInfo, r io.Reader) error + type Snapshot struct + Comment string + CreatedAt time.Time + Host string + ID string + ParentID string + SourceMeta map[string]string + SourceName string + SourceType SourceType + Stats SnapshotStats + Tags []string + type SnapshotFilter struct + After time.Time + Before time.Time + Host string + IDs []string + Name string + Tags []string + Type SourceType + func (f SnapshotFilter) Match(s *Snapshot) bool + type SnapshotStats struct + ChunksNew int + ChunksReused int + ChunksTotal int + CompressionRatio float64 + DeduplicationRatio float64 + DirCount int + Duration time.Duration + FileCount int + NewChunksRawSize int64 + Skipped int + StoredSize int64 + TotalSize int64 + func (s *SnapshotStats) UnmarshalJSON(data []byte) error + func (s SnapshotStats) MarshalJSON() ([]byte, error) + type Source interface + Meta func() SourceMeta + Walk func(ctx context.Context, fn WalkFunc) error + type SourceMeta struct + Labels map[string]string + Name string + Type SourceType + type SourceType string + const SourceTypeFile + type UnlockOption func(*unlockConfig) + func WithForce() UnlockOption + type VerifyResult struct + ChunksChecked int + CorruptChunks []string + MissingChunks []string + OK bool + SnapshotID string + type WalkFunc func(entry FileInfo, r io.Reader) error