Documentation
¶
Index ¶
- type Backend
- func (m *Backend) Close() error
- func (m *Backend) Delete(ctx context.Context) error
- func (m *Backend) IsNotExist(err error) bool
- func (m *Backend) List(ctx context.Context, t restic.FileType) <-chan string
- func (m *Backend) Load(ctx context.Context, h restic.Handle, length int, offset int64) (io.ReadCloser, error)
- func (m *Backend) Location() string
- func (m *Backend) Remove(ctx context.Context, h restic.Handle) error
- func (m *Backend) Save(ctx context.Context, h restic.Handle, rd io.Reader) error
- func (m *Backend) Stat(ctx context.Context, h restic.Handle) (restic.FileInfo, error)
- func (m *Backend) Test(ctx context.Context, h restic.Handle) (bool, error)
- type Repository
- func (repo Repository) Backend() restic.Backend
- func (repo Repository) Config() restic.Config
- func (repo Repository) Flush() error
- func (repo Repository) Index() restic.Index
- func (repo Repository) Key() *crypto.Key
- func (repo Repository) List(t restic.FileType, done <-chan struct{}) <-chan restic.ID
- func (repo Repository) ListPack(id restic.ID) ([]restic.Blob, int64, error)
- func (repo Repository) LoadAndDecrypt(t restic.FileType, id restic.ID) ([]byte, error)
- func (repo Repository) LoadBlob(t restic.BlobType, id restic.ID, buf []byte) (int, error)
- func (repo Repository) LoadIndex() error
- func (repo Repository) LoadJSONUnpacked(t restic.FileType, id restic.ID, item interface{}) error
- func (repo Repository) LoadTree(id restic.ID) (*restic.Tree, error)
- func (repo Repository) LookupBlobSize(id restic.ID, t restic.BlobType) (uint, error)
- func (repo Repository) SaveBlob(t restic.BlobType, buf []byte, id restic.ID) (restic.ID, error)
- func (repo Repository) SaveFullIndex() error
- func (repo Repository) SaveIndex() error
- func (repo Repository) SaveJSONUnpacked(t restic.FileType, item interface{}) (restic.ID, error)
- func (repo Repository) SaveTree(t *restic.Tree) (restic.ID, error)
- func (repo Repository) SaveUnpacked(t restic.FileType, buf []byte) (restic.ID, error)
- func (repo Repository) SetIndex(idx restic.Index)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
CloseFn func() error
IsNotExistFn func(err error) bool
SaveFn func(ctx context.Context, h restic.Handle, rd io.Reader) error
LoadFn func(ctx context.Context, h restic.Handle, length int, offset int64) (io.ReadCloser, error)
StatFn func(ctx context.Context, h restic.Handle) (restic.FileInfo, error)
ListFn func(ctx context.Context, t restic.FileType) <-chan string
RemoveFn func(ctx context.Context, h restic.Handle) error
TestFn func(ctx context.Context, h restic.Handle) (bool, error)
DeleteFn func(ctx context.Context) error
LocationFn func() string
}
Backend implements a mock backend.
func (*Backend) IsNotExist ¶
IsNotExist returns true if the error is caused by a missing file.
func (*Backend) Load ¶
func (m *Backend) Load(ctx context.Context, h restic.Handle, length int, offset int64) (io.ReadCloser, error)
Load loads data from the backend.
type Repository ¶
type Repository struct {
BackendFn func() restic.Backend
KeyFn func() *crypto.Key
SetIndexFn func(restic.Index)
IndexFn func() restic.Index
SaveFullIndexFn func() error
SaveIndexFn func() error
LoadIndexFn func() error
ConfigFn func() restic.Config
LookupBlobSizeFn func(restic.ID, restic.BlobType) (uint, error)
ListFn func(restic.FileType, <-chan struct{}) <-chan restic.ID
ListPackFn func(restic.ID) ([]restic.Blob, int64, error)
FlushFn func() error
SaveUnpackedFn func(restic.FileType, []byte) (restic.ID, error)
SaveJSONUnpackedFn func(restic.FileType, interface{}) (restic.ID, error)
LoadJSONUnpackedFn func(restic.FileType, restic.ID, interface{}) error
LoadAndDecryptFn func(restic.FileType, restic.ID) ([]byte, error)
LoadBlobFn func(restic.BlobType, restic.ID, []byte) (int, error)
SaveBlobFn func(restic.BlobType, []byte, restic.ID) (restic.ID, error)
LoadTreeFn func(restic.ID) (*restic.Tree, error)
SaveTreeFn func(t *restic.Tree) (restic.ID, error)
}
Repository implements a mock Repository.
func (Repository) Backend ¶
func (repo Repository) Backend() restic.Backend
Backend is a stub method.
func (Repository) List ¶
func (repo Repository) List(t restic.FileType, done <-chan struct{}) <-chan restic.ID
List is a stub method.
func (Repository) LoadAndDecrypt ¶
LoadAndDecrypt is a stub method.
func (Repository) LoadJSONUnpacked ¶
LoadJSONUnpacked is a stub method.
func (Repository) LookupBlobSize ¶
LookupBlobSize is a stub method.
func (Repository) SaveFullIndex ¶
func (repo Repository) SaveFullIndex() error
SaveFullIndex is a stub method.
func (Repository) SaveJSONUnpacked ¶
SaveJSONUnpacked is a stub method.
func (Repository) SaveUnpacked ¶
SaveUnpacked is a stub method.
func (Repository) SetIndex ¶
func (repo Repository) SetIndex(idx restic.Index)
SetIndex is a stub method.
Click to show internal directories.
Click to hide internal directories.