Documentation
¶
Overview ¶
Package storetar is the tar store driver: a directory, of the node or of an sftp server, holding, per run, a gzipped tar archive per head and a gzipped file per streamed member.
The runs of an object are under <cluster id>/<object id>/<run id>: several clusters may write one store, an object keeps its runs when renamed, and an object created again at a path does not take the runs of the former one. An object.json beside the runs of an object says the path it had at its last completed run, which a listing by path reads, and a cluster.json beside the objects of a cluster the name it had then, which a listing by cluster name reads. Both are this driver's: another store records the same in its own way, as tags.
It neither deduplicates nor encrypts. It is the reference store of the backup framework, exercising every capability with nothing but the standard library, and a store for tests.
Index ¶
- func New() backup.Driver
- type T
- func (t *T) Backup(ctx context.Context, run backup.Run, member, src, head string, ...) error
- func (t *T) BackupStream(ctx context.Context, run backup.Run, member string, r io.Reader) error
- func (t *T) Cat(ctx context.Context, run backup.Run, member string) (io.ReadCloser, error)
- func (t *T) Check(ctx context.Context, filter backup.RunFilter) error
- func (t *T) Close() error
- func (t *T) Complete(ctx context.Context, run backup.Run) error
- func (t *T) Delete(ctx context.Context, runs []backup.Run) error
- func (t *T) IsLocal() bool
- func (t *T) IsShared() bool
- func (t *T) ObjectStats(ctx context.Context) ([]backup.ObjectStats, error)
- func (t *T) OverSSH(conn *ssh.Client) error
- func (t *T) Restore(ctx context.Context, run backup.Run, member string, dst string) error
- func (t *T) Runs(ctx context.Context, filter backup.RunFilter) ([]backup.Run, error)
- func (t *T) Usage(ctx context.Context) (backup.Usage, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type T ¶
T is the tar store driver.
func (*T) Backup ¶
func (t *T) Backup(ctx context.Context, run backup.Run, member, src, head string, excludes []string) error
Backup saves the directory src as a gzipped tar archive, member of the run.
func (*T) BackupStream ¶
BackupStream saves what r reads as a gzipped file, member of the run.
func (*T) Cat ¶
Cat returns a reader of the member of the run: the document of a streamed member, the tar archive of a head.
func (*T) Check ¶
Check reads every member of the runs filter selects to its end, which the gzip checksums verify.
func (*T) IsShared ¶
IsShared implements backup.Sharer: an sftp store is the same for every node, and a directory of the node is when its shared keyword says so, as an nfs mount.
func (*T) ObjectStats ¶
ObjectStats returns the stats every object of the store records, of every cluster, the cluster named as it is now. An object whose marker holds none, written before the stats were, is recounted from its directory, without writing it.
func (*T) OverSSH ¶
OverSSH implements backup.Sharer: the store is the directory of the url on the node conn is connected to, read and written over sftp, conn closed at Close.
func (*T) Restore ¶
Restore writes the member of the run into dst: the tree of a head, or the file of a streamed member, named after it.