Documentation
¶
Index ¶
- func IsDirectoryARepository(basedir string) bool
- func ResticProgramName() string
- type EnvValue
- type File
- type Location
- type Repository
- func (r *Repository) DumpFile(snapshot *Snapshot, file *File, targetPath string) (string, error)
- func (r *Repository) GetFiles(snapshot *Snapshot, path string) ([]*File, error)
- func (r *Repository) GetSnapshots() ([]*Snapshot, error)
- func (r *Repository) RestoreFile(snapshot *Snapshot, file *File, targetPath string) error
- type Restic
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDirectoryARepository ¶
IsDirectoryARepository returns true if the given directory contains everything a restic repository contains
func ResticProgramName ¶
func ResticProgramName() string
ResticProgramName returns the expected platform dependend restic program name
Types ¶
type File ¶
type File struct {
Name string `json:"name"`
Type string `json:"type"`
Path string `json:"path"`
UID int `json:"uid,omitempty"`
Gid int `json:"gid,omitempty"`
Size int `json:"size,omitempty"`
Mode int `json:"mode,omitempty"`
Mtime string `json:"mtime,omitempty"`
Atime string `json:"atime,omitempty"`
Ctime string `json:"ctime,omitempty"`
}
contains all the data relating to a restic File
type Location ¶
type Location struct {
Prefix string `json:"prefix"` // e.g. "b2"
Path string `json:"path"` // local path or url or bucket name
Credientials []EnvValue `json:"credentials"` // optional env values
}
Defines a repository location for restic
func (*Location) PathOrBucketName ¶
return plain location path for local repositories, else prepends the prefix
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository holds all information about a repository
func NewRepository ¶
func NewRepository(location Location, password string, restic *Restic) *Repository
NewRepository creates a new Repository struct
func (*Repository) GetFiles ¶
func (r *Repository) GetFiles(snapshot *Snapshot, path string) ([]*File, error)
func (*Repository) GetSnapshots ¶
func (r *Repository) GetSnapshots() ([]*Snapshot, error)
func (*Repository) RestoreFile ¶
func (r *Repository) RestoreFile(snapshot *Snapshot, file *File, targetPath string) error
type Restic ¶
type Restic struct {
VersionString string
Version string
// contains filtered or unexported fields
}
Restic holds information about the Restic Binary
func NewResticFromPath ¶
NewResticFromPath creates a new Restic struct from the given file path
func (*Restic) NewRepo ¶
func (r *Restic) NewRepo(location Location, password string) (*Repository, error)
NewRepo creates a new repo instance
Click to show internal directories.
Click to hide internal directories.