Versions in this module Expand all Collapse all v0 v0.8.3 Feb 26, 2018 Changes in this version + func DownloadAndHash(ctx context.Context, repo restic.Repository, h restic.Handle) (tmpfile *os.File, hash restic.ID, size int64, err error) v0.8.2 Feb 17, 2018 v0.8.1 Dec 27, 2017 v0.8.0 Nov 26, 2017 Changes in this version + var Params *crypto.Params type Index + func (idx *Index) TreePacks() restic.IDs type Repository + func (r *Repository) UseCache(c restic.Cache) v0.7.3 Sep 20, 2017 v0.7.2 Sep 13, 2017 Changes in this version + var ErrMaxKeysReached = errors.Fatal("maximum number of keys reached") + var ErrNoKeyFound = errors.Fatal("wrong password or no key found") + var ErrOldIndexFormat = errors.New("index has old format") + var IndexFull = func(idx *Index) bool + var KDFMemory = 60 + var KDFParams *crypto.KDFParams + var KDFTimeout = 500 * time.Millisecond + func FilesInParallel(ctx context.Context, repo restic.Lister, t restic.FileType, n uint, ...) error + func Repack(ctx context.Context, repo restic.Repository, packs restic.IDSet, ...) (obsoletePacks restic.IDSet, err error) + func SaveIndex(ctx context.Context, repo restic.Repository, index *Index) (restic.ID, error) + func TestBackend(t testing.TB) (be restic.Backend, cleanup func()) + func TestOpenLocal(t testing.TB, dir string) (r restic.Repository) + func TestRepository(t testing.TB) (r restic.Repository, cleanup func()) + func TestRepositoryWithBackend(t testing.TB, be restic.Backend) (r restic.Repository, cleanup func()) + func TestUseLowSecurityKDFParameters(t logger) + type Index struct + func DecodeIndex(buf []byte) (idx *Index, err error) + func DecodeOldIndex(buf []byte) (idx *Index, err error) + func LoadIndex(ctx context.Context, repo restic.Repository, id restic.ID) (*Index, error) + func LoadIndexWithDecoder(ctx context.Context, repo restic.Repository, id restic.ID, ...) (idx *Index, err error) + func NewIndex() *Index + func (idx *Index) AddToSupersedes(ids ...restic.ID) error + func (idx *Index) Count(t restic.BlobType) (n uint) + func (idx *Index) Dump(w io.Writer) error + func (idx *Index) Each(ctx context.Context) <-chan restic.PackedBlob + func (idx *Index) Encode(w io.Writer) error + func (idx *Index) Final() bool + func (idx *Index) Finalize(w io.Writer) error + func (idx *Index) Has(id restic.ID, tpe restic.BlobType) bool + func (idx *Index) ID() (restic.ID, error) + func (idx *Index) ListPack(id restic.ID) (list []restic.PackedBlob) + func (idx *Index) Lookup(id restic.ID, tpe restic.BlobType) (blobs []restic.PackedBlob, err error) + func (idx *Index) LookupSize(id restic.ID, tpe restic.BlobType) (plaintextLength uint, err error) + func (idx *Index) Packs() restic.IDSet + func (idx *Index) SetID(id restic.ID) error + func (idx *Index) Store(blob restic.PackedBlob) + func (idx *Index) Supersedes() restic.IDs + type Key struct + Created time.Time + Data []byte + Hostname string + KDF string + N int + P int + R int + Salt []byte + Username string + func AddKey(ctx context.Context, s *Repository, password string, template *crypto.Key) (*Key, error) + func LoadKey(ctx context.Context, s *Repository, name string) (k *Key, err error) + func OpenKey(ctx context.Context, s *Repository, name string, password string) (*Key, error) + func SearchKey(ctx context.Context, s *Repository, password string, maxKeys int) (*Key, error) + func (k *Key) String() string + func (k *Key) Valid() bool + func (k Key) Name() string + type MasterIndex struct + func NewMasterIndex() *MasterIndex + func (mi *MasterIndex) All() []*Index + func (mi *MasterIndex) Count(t restic.BlobType) (n uint) + func (mi *MasterIndex) Each(ctx context.Context) <-chan restic.PackedBlob + func (mi *MasterIndex) FullIndexes() []*Index + func (mi *MasterIndex) Has(id restic.ID, tpe restic.BlobType) bool + func (mi *MasterIndex) Insert(idx *Index) + func (mi *MasterIndex) ListPack(id restic.ID) (list []restic.PackedBlob) + func (mi *MasterIndex) Lookup(id restic.ID, tpe restic.BlobType) (blobs []restic.PackedBlob, err error) + func (mi *MasterIndex) LookupSize(id restic.ID, tpe restic.BlobType) (uint, error) + func (mi *MasterIndex) NotFinalIndexes() []*Index + func (mi *MasterIndex) RebuildIndex(packBlacklist restic.IDSet) (*Index, error) + func (mi *MasterIndex) Remove(index *Index) + func (mi *MasterIndex) Store(pb restic.PackedBlob) + type Packer struct + type ParallelIDWorkFunc func(ctx context.Context, id restic.ID) error + type ParallelWorkFunc func(ctx context.Context, id string) error + func ParallelWorkFuncParseID(f ParallelIDWorkFunc) ParallelWorkFunc + type Repository struct + func New(be restic.Backend) *Repository + func (r *Repository) Backend() restic.Backend + func (r *Repository) Close() error + func (r *Repository) Config() restic.Config + func (r *Repository) Delete(ctx context.Context) error + func (r *Repository) Encrypt(ciphertext, plaintext []byte) ([]byte, error) + func (r *Repository) Flush() error + func (r *Repository) Index() restic.Index + func (r *Repository) Init(ctx context.Context, password string) error + func (r *Repository) Key() *crypto.Key + func (r *Repository) KeyName() string + func (r *Repository) List(ctx context.Context, t restic.FileType) <-chan restic.ID + func (r *Repository) ListPack(ctx context.Context, id restic.ID) ([]restic.Blob, int64, error) + func (r *Repository) LoadAndDecrypt(ctx context.Context, t restic.FileType, id restic.ID) ([]byte, error) + func (r *Repository) LoadBlob(ctx context.Context, t restic.BlobType, id restic.ID, buf []byte) (int, error) + func (r *Repository) LoadIndex(ctx context.Context) error + func (r *Repository) LoadJSONUnpacked(ctx context.Context, t restic.FileType, id restic.ID, item interface{}) (err error) + func (r *Repository) LoadTree(ctx context.Context, id restic.ID) (*restic.Tree, error) + func (r *Repository) LookupBlobSize(id restic.ID, tpe restic.BlobType) (uint, error) + func (r *Repository) PrefixLength(t restic.FileType) (int, error) + func (r *Repository) SaveAndEncrypt(ctx context.Context, t restic.BlobType, data []byte, id *restic.ID) (restic.ID, error) + func (r *Repository) SaveBlob(ctx context.Context, t restic.BlobType, buf []byte, id restic.ID) (restic.ID, error) + func (r *Repository) SaveFullIndex(ctx context.Context) error + func (r *Repository) SaveIndex(ctx context.Context) error + func (r *Repository) SaveJSONUnpacked(ctx context.Context, t restic.FileType, item interface{}) (restic.ID, error) + func (r *Repository) SaveTree(ctx context.Context, t *restic.Tree) (restic.ID, error) + func (r *Repository) SaveUnpacked(ctx context.Context, t restic.FileType, p []byte) (id restic.ID, err error) + func (r *Repository) SearchKey(ctx context.Context, password string, maxKeys int) error + func (r *Repository) SetIndex(i restic.Index) + type Saver interface + Save func(context.Context, restic.Handle, io.Reader) error