middleware

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

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

FS is a storage.FS implementation that wraps another storage.FS and calls hooks before and after each method.

func NewFS

func NewFS(next storage.FS, hooks ...Hook) *FS

func (*FS) AddGrant

func (f *FS) AddGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error

func (*FS) AddLabel

func (f *FS) AddLabel(ctx context.Context, ref *provider.Reference, userID *userpb.UserId, label string) error

func (*FS) CommitUpload

func (f *FS) CommitUpload(ctx context.Context, ref *provider.Reference, sessionID string, source storage.UploadSource) error

func (*FS) CreateDir

func (f *FS) CreateDir(ctx context.Context, ref *provider.Reference) (*storage.CreateDirResult, error)

func (*FS) CreateHome

func (f *FS) CreateHome(ctx context.Context) error

func (*FS) CreateReference

func (f *FS) CreateReference(ctx context.Context, path string, targetURI *url.URL) error

func (*FS) Delete

func (f *FS) Delete(ctx context.Context, ref *provider.Reference) (*storage.DeleteResult, error)

func (*FS) DenyGrant

func (f *FS) DenyGrant(ctx context.Context, ref *provider.Reference, g *provider.Grantee) error

func (*FS) Download

func (f *FS) Download(ctx context.Context, ref *provider.Reference, openReaderFunc func(md *provider.ResourceInfo) bool) (*provider.ResourceInfo, io.ReadCloser, error)

func (*FS) DownloadRevision

func (f *FS) DownloadRevision(ctx context.Context, ref *provider.Reference, key string, openReaderFunc func(md *provider.ResourceInfo) bool) (*provider.ResourceInfo, io.ReadCloser, error)

func (*FS) EmptyRecycle

func (f *FS) EmptyRecycle(ctx context.Context, ref *provider.Reference) error

func (*FS) GetHome

func (f *FS) GetHome(ctx context.Context) (string, error)

func (*FS) GetLock

func (f *FS) GetLock(ctx context.Context, ref *provider.Reference) (*provider.Lock, error)

func (*FS) GetMD

func (f *FS) GetMD(ctx context.Context, ref *provider.Reference, mdKeys, fieldMask []string) (*provider.ResourceInfo, error)

func (*FS) GetPathByID

func (f *FS) GetPathByID(ctx context.Context, id *provider.ResourceId) (string, error)

func (*FS) GetQuota

func (f *FS) GetQuota(ctx context.Context, ref *provider.Reference) (uint64, uint64, uint64, error)

func (*FS) IsOrphaned

func (f *FS) IsOrphaned(ctx context.Context, ref *provider.Reference) bool

IsOrphaned reports whether the referenced resource exists but its metadata is unreadable.

func (*FS) ListFolder

func (f *FS) ListFolder(ctx context.Context, ref *provider.Reference, mdKeys, fieldMask []string) ([]*provider.ResourceInfo, error)

func (*FS) ListGrants

func (f *FS) ListGrants(ctx context.Context, ref *provider.Reference) ([]*provider.Grant, error)

func (*FS) ListRecycle

func (f *FS) ListRecycle(ctx context.Context, ref *provider.Reference, key, relativePath string) ([]*provider.RecycleItem, error)

func (*FS) ListRevisions

func (f *FS) ListRevisions(ctx context.Context, ref *provider.Reference) ([]*provider.FileVersion, error)

func (*FS) ListStorageSpaces

func (f *FS) ListStorageSpaces(ctx context.Context, filter []*provider.ListStorageSpacesRequest_Filter, unrestricted bool) ([]*provider.StorageSpace, error)

func (*FS) MarkProcessing

func (f *FS) MarkProcessing(ctx context.Context, ref *provider.Reference, processing bool, sessionID string) error

func (*FS) Move

func (f *FS) Move(ctx context.Context, oldRef, newRef *provider.Reference) (*storage.MoveResult, error)

func (*FS) PrepareCreatesNode

func (f *FS) PrepareCreatesNode() bool

PrepareCreatesNode reports whether the wrapped driver's PrepareUpload creates a new file's node.

func (*FS) PrepareUpload

func (f *FS) PrepareUpload(ctx context.Context, ref *provider.Reference, sessionID string, info storage.UploadInfo) (*storage.PrepareUploadResult, error)

func (*FS) PurgeRecycleItem

func (f *FS) PurgeRecycleItem(ctx context.Context, ref *provider.Reference, key, relativePath string) error

func (*FS) RefreshLock

func (f *FS) RefreshLock(ctx context.Context, ref *provider.Reference, lock *provider.Lock, existingLockID string) error

func (*FS) RemoveGrant

func (f *FS) RemoveGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error

func (*FS) RemoveLabel

func (f *FS) RemoveLabel(ctx context.Context, ref *provider.Reference, userID *userpb.UserId, label string) error

func (*FS) RestoreRecycleItem

func (f *FS) RestoreRecycleItem(ctx context.Context, ref *provider.Reference, key, relativePath string, restoreRef *provider.Reference) (*storage.RestoreRecycleItemResult, error)

func (*FS) RestoreRevision

func (f *FS) RestoreRevision(ctx context.Context, ref *provider.Reference, key string) (*storage.RestoreRevisionResult, error)

func (*FS) RollbackUpload

func (f *FS) RollbackUpload(ctx context.Context, ref *provider.Reference, sessionID string, info storage.RollbackInfo) error

func (*FS) SetArbitraryMetadata

func (f *FS) SetArbitraryMetadata(ctx context.Context, ref *provider.Reference, md *provider.ArbitraryMetadata) error

func (*FS) SetLock

func (f *FS) SetLock(ctx context.Context, ref *provider.Reference, lock *provider.Lock) (*storage.SetLockResult, error)

func (*FS) Shutdown

func (f *FS) Shutdown(ctx context.Context) error

func (*FS) TouchFile

func (f *FS) TouchFile(ctx context.Context, ref *provider.Reference, markprocessing bool, mtime string) (*storage.TouchFileResult, error)

func (*FS) Unlock

func (f *FS) Unlock(ctx context.Context, ref *provider.Reference, lock *provider.Lock) (*storage.UnlockResult, error)

func (*FS) UnsetArbitraryMetadata

func (f *FS) UnsetArbitraryMetadata(ctx context.Context, ref *provider.Reference, keys []string) error

func (*FS) UpdateGrant

func (f *FS) UpdateGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error

func (*FS) WithDisabledSpaces

func (fs *FS) WithDisabledSpaces() storage.FS

WithDisabledSpaces returns a filesystem that can list disabled spaces

type Hook

type Hook func(methodName string, ctx context.Context, spaceID string) (context.Context, UnHook, error)

Hook is a function that is called before the actual method is executed.

type UnHook

type UnHook func() error

UnHook is a function that is called after the actual method is executed.

Jump to

Keyboard shortcuts

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