Documentation
¶
Index ¶
- type Backend
- func (m *Backend) Close() error
- func (m *Backend) Delete(ctx context.Context) error
- func (m *Backend) Hasher() hash.Hash
- func (m *Backend) IsNotExist(err error) bool
- func (m *Backend) IsPermanentError(err error) bool
- func (m *Backend) List(ctx context.Context, t backend.FileType, fn func(backend.FileInfo) error) error
- func (m *Backend) Load(ctx context.Context, h backend.Handle, length int, offset int64, ...) error
- func (m *Backend) Properties() backend.Properties
- func (m *Backend) Remove(ctx context.Context, h backend.Handle) error
- func (m *Backend) Save(ctx context.Context, h backend.Handle, rd backend.RewindReader) error
- func (m *Backend) Stat(ctx context.Context, h backend.Handle) (backend.FileInfo, error)
- func (m *Backend) Warmup(ctx context.Context, h []backend.Handle) ([]backend.Handle, error)
- func (m *Backend) WarmupWait(ctx context.Context, h []backend.Handle) 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 IsPermanentErrorFn func(err error) bool SaveFn func(ctx context.Context, h backend.Handle, rd backend.RewindReader) error OpenReaderFn func(ctx context.Context, h backend.Handle, length int, offset int64) (io.ReadCloser, error) StatFn func(ctx context.Context, h backend.Handle) (backend.FileInfo, error) ListFn func(ctx context.Context, t backend.FileType, fn func(backend.FileInfo) error) error RemoveFn func(ctx context.Context, h backend.Handle) error DeleteFn func(ctx context.Context) error WarmupFn func(ctx context.Context, h []backend.Handle) ([]backend.Handle, error) WarmupWaitFn func(ctx context.Context, h []backend.Handle) error PropertiesFn func() backend.Properties HasherFn func() hash.Hash }
Backend implements a mock backend.
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) IsPermanentError ¶ added in v0.17.0
func (*Backend) List ¶
func (m *Backend) List(ctx context.Context, t backend.FileType, fn func(backend.FileInfo) error) error
List items of type t.
func (*Backend) Load ¶
func (m *Backend) Load(ctx context.Context, h backend.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.
func (*Backend) Properties ¶ added in v0.18.0
func (m *Backend) Properties() backend.Properties
Click to show internal directories.
Click to hide internal directories.