package
0.0.0-20230227070331-53483ec82e17
Repository: https://github.com/rubiojr/rapi.git
Documentation: pkg.go.dev
# Functions
ApplyPolicy returns the snapshots from list that are to be kept and removed according to the policy p.
CiphertextLength returns the encrypted length of a blob with plaintextSize bytes.
CreateConfig creates a config file with a randomly selected polynomial and ID.
Find loads the list of all files of type t and searches for names which start with prefix.
FindFilteredSnapshots yields Snapshots filtered from the list of all snapshots.
FindLatestSnapshot finds latest snapshot with optional target/directory, tags, hostname, and timestamp filters.
FindSnapshot takes a string and tries to find a snapshot whose ID matches the string as closely as possible.
FindUsedBlobs traverses the tree ID and adds all seen blobs (trees and data blobs) to the set blobs.
FixTime returns a time.Time which can safely be used to marshal as JSON.
ForAllLocks reads all locks in parallel and calls the given callback.
ForAllSnapshots reads all snapshots in parallel and calls the given function.
Getxattr retrieves extended attribute data associated with path.
GroupSnapshots takes a list of snapshots and a grouping criteria and creates a group list of snapshots.
Hash returns the ID for data.
IDFromHash returns the ID for the hash.
IsAlreadyLocked returns true iff err is an instance of ErrAlreadyLocked.
Listxattr retrieves a list of names of extended attributes associated with the given path in the file system.
LoadConfig returns loads, checks and returns the config for a repository.
LoadLock loads and unserializes a lock from a repository.
LoadSnapshot loads the snapshot with the id and returns it.
NewBlobBuffer returns a buffer that is large enough to hold a blob of size plaintext bytes, including the crypto overhead.
NewBlobSet returns a new BlobSet, populated with ids.
NewByteReader prepares a ByteReader that can then be used to read buf.
NewExclusiveLock returns a new, exclusive lock for the repository.
NewFileReader wraps f in a *FileReader.
NewHardlinkIndex create a new index for hard links.
NewIDSet returns a new IDSet, populated with ids.
NewLock returns a new, non-exclusive lock for the repository.
NewProgress returns a new progress reporter.
No description provided by the author
NewRandomID returns a randomly generated ID.
NewSnapshot returns an initialized snapshot struct for the current user and time.
NewTree creates a new tree object with the given initial capacity.
NodeFromFileInfo returns a new node from the given path and FileInfo.
ParseDuration parses a duration from a string.
ParseID converts the given string to an ID.
PlaintextLength returns the plaintext length of a blob with ciphertextSize bytes.
PrefixLength returns the number of bytes required so that all prefixes of all names of type t are unique.
ReadAt reads from the backend handle h at the given position.
ReaderAt returns an io.ReaderAt for a file in the backend.
RemoveAllLocks removes all locks forcefully.
RemoveStaleLocks deletes all locks detected as stale from the repository.
Setxattr associates name and data together as an attribute of path.
StreamTrees iteratively loads the given trees and their subtrees.
TestCreateConfig creates a config for use within tests.
TestCreateSnapshot creates a snapshot filled with fake data.
TestDisableCheckPolynomial disables the check that the polynomial used for the chunker.
TestParseHandle parses s as a ID, panics if that fails and creates a BlobHandle with t.
TestParseID parses s as a ID and panics if that fails.
TestSetLockTimeout can be used to reduce the lock wait timeout for tests.
# Constants
These are the different data types a backend can store.
These are the blob types that can be stored in a pack.
These are the different data types a backend can store.
These are the blob types that can be stored in a pack.
These are the different data types a backend can store.
These are the different data types a backend can store.
Number of types.
use data, as packs are stored under /data in repo.
RepoVersion is the version that is written to the config when a repository is newly created with Init().
These are the different data types a backend can store.
These are the blob types that can be stored in a pack.
# Variables
ErrNoSnapshotFound is returned when no snapshot for the given criteria could be found.
# Structs
Blob is one part of a file or a tree.
BlobHandle identifies a blob of a given type.
ByteReader implements a RewindReader for a byte slice.
Config contains the configuration for a repository.
Duration is similar to time.Duration, except it only supports larger ranges like hours, days, months, and years.
ErrAlreadyLocked is returned when NewLock or NewExclusiveLock are unable to acquire the desired lock.
ExpirePolicy configures which snapshots should be automatically removed.
ExtendedAttribute is a tuple storing the xattr name and value.
FileInfo is contains information about a file in the backend.
FileReader implements a RewindReader for an open file.
Handle is used to store and access data in a backend.
HardlinkIndex contains a list of inodes, devices these inodes are one, and associated file names.
HardlinkKey is a composed key for finding inodes on a specific device.
KeepReason specifies why a particular snapshot was kept, and the counters at that point in the policy evaluation.
Lock represents a process locking the repository for an operation.
A MultipleIDMatchesError is returned by Find() when multiple IDs with a given prefix are found.
Node is a file, directory or other item in a backup.
A NoIDByPrefixError is returned by Find() when no ID for a given prefix could be found.
PackedBlob is a blob stored within a file.
Progress reports progress on an operation.
Snapshot is the state of a resource at one point in time.
SnapshotGroupKey is the structure for identifying groups in a grouped snapshot list.
Stat captures newly done parts of the operation.
Tree is an ordered list of nodes.
TreeItem is used to return either an error or the tree for a tree id.
# Interfaces
Backend is used to store and access data.
JSONUnpackedLoader loads unpacked JSON.
Lister allows listing files in a backend.
MasterIndex keeps track of the blobs are stored within files.
Repository stores data in a backend.
RewindReader allows resetting the Reader to the beginning of the data.
TreeLoader loads a tree from a repository.
# Type aliases
BlobHandles is an ordered list of BlobHandles that implements sort.Interface.
BlobSet is a set of blobs.
BlobType specifies what a blob stored in a pack is.
FileType is the type of a file in the backend.
ID references content within a repository.
IDs is an ordered list of IDs that implements sort.Interface.
IDSet is a set of IDs.
Nodes is a slice of nodes that can be sorted.
ProgressFunc is used to report progress back to the user.
Snapshots is a list of snapshots.
TagList is a list of tags.
TagLists consists of several TagList.