cache

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(store Store) webdav.Middleware

Types

type FileSystem

type FileSystem struct {
	// contains filtered or unexported fields
}

func NewFileSystem

func NewFileSystem(backend webdav.FileSystem, store Store) *FileSystem

func (*FileSystem) Mkdir

func (fs *FileSystem) Mkdir(ctx context.Context, name string, perm os.FileMode) error

func (*FileSystem) OpenFile

func (fs *FileSystem) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (webdav.File, error)

func (*FileSystem) RemoveAll

func (fs *FileSystem) RemoveAll(ctx context.Context, name string) error

func (*FileSystem) Rename

func (fs *FileSystem) Rename(ctx context.Context, oldName, newName string) error

func (*FileSystem) Stat

func (fs *FileSystem) Stat(ctx context.Context, name string) (os.FileInfo, error)

type MemoryStore

type MemoryStore struct {
	// contains filtered or unexported fields
}

func NewMemoryStore

func NewMemoryStore(ttl time.Duration) *MemoryStore

func (*MemoryStore) Get

func (m *MemoryStore) Get(ctx context.Context, path string) (os.FileInfo, bool, error)

func (*MemoryStore) GetChildren

func (m *MemoryStore) GetChildren(ctx context.Context, path string) ([]os.FileInfo, bool, error)

func (*MemoryStore) Invalidate

func (m *MemoryStore) Invalidate(ctx context.Context, path string) error

func (*MemoryStore) InvalidateChildren

func (m *MemoryStore) InvalidateChildren(ctx context.Context, path string) error

func (*MemoryStore) Put

func (m *MemoryStore) Put(ctx context.Context, path string, info os.FileInfo) error

func (*MemoryStore) PutChildren

func (m *MemoryStore) PutChildren(ctx context.Context, path string, children []os.FileInfo) error

type Store

type Store interface {
	Get(ctx context.Context, path string) (os.FileInfo, bool, error)
	Put(ctx context.Context, path string, info os.FileInfo) error
	Invalidate(ctx context.Context, path string) error
	GetChildren(ctx context.Context, path string) ([]os.FileInfo, bool, error)
	PutChildren(ctx context.Context, path string, children []os.FileInfo) error
	InvalidateChildren(ctx context.Context, path string) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL