Versions in this module Expand all Collapse all v0 v0.1.0 Nov 12, 2022 v0.0.1 Nov 10, 2022 Changes in this version + const ExtractFnameSetID + var ErrCannotCancel = errors.New("cannot cancel: import already finished") + var Stop = errors.New("stop iteration") + func CleanupAbandondedImports() (cleaned int, err error) + func EstimateSnapshotSize(si *snap.Info, usernames []string, opts *dirs.SnapDirOptions) (uint64, error) + func Filename(snapshot *client.Snapshot) string + func Import(ctx context.Context, id uint64, r io.Reader, flags *ImportFlags) (snapNames []string, err error) + func Iter(ctx context.Context, f func(*Reader) error) error + func LastSnapshotSetID() (uint64, error) + func List(ctx context.Context, setID uint64, snapNames []string) ([]client.SnapshotSet, error) + func MockUserLookup(newLookup func(string) (*user.User, error)) func() + func Save(ctx context.Context, id uint64, si *snap.Info, cfg map[string]interface{}, ...) (*client.Snapshot, error) + type DuplicatedSnapshotImportError struct + SetID uint64 + SnapNames []string + func (e DuplicatedSnapshotImportError) Error() string + type ImportFlags struct + NoDuplicatedImportCheck bool + type Logf func(format string, args ...interface{}) + type Reader struct + func Open(fn string, setID uint64) (reader *Reader, e error) + func (r *Reader) Check(ctx context.Context, usernames []string) error + func (r *Reader) Restore(ctx context.Context, current snap.Revision, usernames []string, logf Logf, ...) (rs *RestoreState, e error) + type RestoreState struct + Config map[string]interface{} + Created []string + Done bool + Moved []string + func (rs *RestoreState) Cleanup() + func (rs *RestoreState) Revert() + type SnapshotExport struct + func NewSnapshotExport(ctx context.Context, setID uint64) (se *SnapshotExport, err error) + func (se *SnapshotExport) Close() + func (se *SnapshotExport) Init() error + func (se *SnapshotExport) Size() int64 + func (se *SnapshotExport) StreamTo(w io.Writer) error