Documentation ¶
Index ¶
- type Backend
- func (m *Backend) Close() error
- func (m *Backend) Connections() uint
- func (m *Backend) Delete(ctx context.Context) error
- func (m *Backend) HasAtomicReplace() bool
- func (m *Backend) Hasher() hash.Hash
- func (m *Backend) IsNotExist(err error) bool
- func (m *Backend) List(ctx context.Context, t restic.FileType, fn func(restic.FileInfo) error) error
- func (m *Backend) Load(ctx context.Context, h restic.Handle, length int, offset int64, ...) 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 restic.RewindReader) error
- func (m *Backend) Stat(ctx context.Context, h restic.Handle) (restic.FileInfo, error)
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 restic.RewindReader) error OpenReaderFn 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, fn func(restic.FileInfo) error) error RemoveFn func(ctx context.Context, h restic.Handle) error DeleteFn func(ctx context.Context) error ConnectionsFn func() uint LocationFn func() string HasherFn func() hash.Hash HasAtomicReplaceFn func() bool }
Backend implements a mock backend.
func (*Backend) Connections ¶
func (*Backend) HasAtomicReplace ¶
HasAtomicReplace returns whether Save() can atomically replace files
func (*Backend) Hasher ¶
Hasher may return a hash function for calculating a content hash for the backend
func (*Backend) IsNotExist ¶
IsNotExist returns true if the error is caused by a missing file.
func (*Backend) List ¶
func (m *Backend) List(ctx context.Context, t restic.FileType, fn func(restic.FileInfo) error) error
List items of type t.
func (*Backend) Load ¶
func (m *Backend) Load(ctx context.Context, h restic.Handle, length int, offset int64, fn func(rd io.Reader) error) error
Load runs fn with a reader that yields the contents of the file at h at the given offset.
Click to show internal directories.
Click to hide internal directories.