snapshot

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package snapshot holds the point-in-time copies of browser files that extractors read instead of a live profile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(from, into string, isDir bool) error

Copy copies a file together with its SQLite -wal and -shm sidecars, or a directory minus every entry named *lock.

Types

type Dir

type Dir struct {
	// contains filtered or unexported fields
}

Dir is a snapshot directory, laid out as <dir>/<UserDataDirID>/<RelativePath>: one Snapshot per user data dir.

func Open

func Open(path string) *Dir

Open uses an existing snapshot directory in place; Close leaves it there.

func Temp

func Temp() (*Dir, error)

Temp creates a private temporary snapshot directory, which Close removes.

func Unzip

func Unzip(archivePath string) (*Dir, error)

Unzip extracts an archive into a temporary snapshot directory, rejecting entries that would land outside it.

func (*Dir) Capture

func (d *Dir) Capture(ctx context.Context, files []File) error

Capture keeps a file's own failure for Snapshot.Path instead of stopping the rest of the capture.

func (*Dir) Close

func (d *Dir) Close() error

func (*Dir) Path

func (d *Dir) Path() string

func (*Dir) Snapshot

func (d *Dir) Snapshot(userDataDirID string) Snapshot

func (*Dir) Zip

func (d *Dir) Zip(archivePath string) error

type File

type File struct {
	UserDataDirID   string // the user data dir's ID; also the snapshot it lands in
	UserDataDirPath string // absolute path of the user data dir it is copied from
	RelativePath    string // slash-separated path relative to UserDataDirPath, and to the snapshot
	IsDir           bool
}

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

func (Snapshot) Path

func (s Snapshot) Path(relativePath string) (string, error)

Path reports fs.ErrNotExist for a file never captured or gone before Capture reached it, else the copy's error.

Jump to

Keyboard shortcuts

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