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, 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)
- func (m *Backend) Test(ctx context.Context, h restic.Handle) (bool, 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 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 NewBackend ¶ added in v0.8.3
func NewBackend() *Backend
NewBackend returns new mock Backend instance
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.