Documentation ¶
Index ¶
- func New(o *options.Options, aspects aspects.Aspects) (storage.FS, error)
- func NewDefault(m map[string]interface{}, bs tree.Blobstore, es events.Stream) (storage.FS, error)
- func ReadSpaceAndNodeFromIndexLink(link string) (string, string, error)
- type Decomposedfs
- func (fs *Decomposedfs) AddGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) (err error)
- func (fs *Decomposedfs) AsConcatableUpload(up tusd.Upload) tusd.ConcatableUpload
- func (fs *Decomposedfs) AsLengthDeclarableUpload(up tusd.Upload) tusd.LengthDeclarableUpload
- func (fs *Decomposedfs) AsTerminatableUpload(up tusd.Upload) tusd.TerminatableUpload
- func (fs *Decomposedfs) CreateDir(ctx context.Context, ref *provider.Reference) (err error)
- func (fs *Decomposedfs) CreateHome(ctx context.Context) (err error)
- func (fs *Decomposedfs) CreateReference(ctx context.Context, p string, targetURI *url.URL) (err error)
- func (fs *Decomposedfs) CreateStorageSpace(ctx context.Context, req *provider.CreateStorageSpaceRequest) (*provider.CreateStorageSpaceResponse, error)
- func (fs *Decomposedfs) Delete(ctx context.Context, ref *provider.Reference) (err error)
- func (fs *Decomposedfs) DeleteRevision(ctx context.Context, ref *provider.Reference, revisionKey string) error
- func (fs *Decomposedfs) DeleteStorageSpace(ctx context.Context, req *provider.DeleteStorageSpaceRequest) error
- func (fs *Decomposedfs) DenyGrant(ctx context.Context, ref *provider.Reference, grantee *provider.Grantee) error
- func (fs *Decomposedfs) Download(ctx context.Context, ref *provider.Reference) (io.ReadCloser, error)
- func (fs *Decomposedfs) DownloadRevision(ctx context.Context, ref *provider.Reference, revisionKey string) (io.ReadCloser, error)
- func (fs *Decomposedfs) EmptyRecycle(ctx context.Context, ref *provider.Reference) error
- func (fs *Decomposedfs) GetHome(ctx context.Context) (string, error)
- func (fs *Decomposedfs) GetLock(ctx context.Context, ref *provider.Reference) (*provider.Lock, error)
- func (fs *Decomposedfs) GetMD(ctx context.Context, ref *provider.Reference, mdKeys []string, ...) (ri *provider.ResourceInfo, err error)
- func (fs *Decomposedfs) GetPathByID(ctx context.Context, id *provider.ResourceId) (string, error)
- func (fs *Decomposedfs) GetQuota(ctx context.Context, ref *provider.Reference) (total uint64, inUse uint64, remaining uint64, err error)
- func (fs *Decomposedfs) GetUpload(ctx context.Context, id string) (tusd.Upload, error)
- func (fs *Decomposedfs) InitiateUpload(ctx context.Context, ref *provider.Reference, uploadLength int64, ...) (map[string]string, error)
- func (fs *Decomposedfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKeys []string, ...) ([]*provider.ResourceInfo, error)
- func (fs *Decomposedfs) ListGrants(ctx context.Context, ref *provider.Reference) (grants []*provider.Grant, err error)
- func (fs *Decomposedfs) ListRecycle(ctx context.Context, ref *provider.Reference, key, relativePath string) ([]*provider.RecycleItem, error)
- func (fs *Decomposedfs) ListRevisions(ctx context.Context, ref *provider.Reference) (revisions []*provider.FileVersion, err error)
- func (fs *Decomposedfs) ListStorageSpaces(ctx context.Context, filter []*provider.ListStorageSpacesRequest_Filter, ...) ([]*provider.StorageSpace, error)
- func (fs *Decomposedfs) ListUploadSessions(ctx context.Context, filter storage.UploadSessionFilter) ([]storage.UploadSession, error)
- func (fs *Decomposedfs) Move(ctx context.Context, oldRef, newRef *provider.Reference) (err error)
- func (fs *Decomposedfs) MustCheckNodePermissions(ctx context.Context, unrestricted bool) bool
- func (fs *Decomposedfs) NewUpload(ctx context.Context, info tusd.FileInfo) (tusd.Upload, error)
- func (fs *Decomposedfs) Postprocessing(ch <-chan events.Event)
- func (fs *Decomposedfs) PurgeRecycleItem(ctx context.Context, ref *provider.Reference, key, relativePath string) error
- func (fs *Decomposedfs) RefreshLock(ctx context.Context, ref *provider.Reference, lock *provider.Lock, ...) error
- func (fs *Decomposedfs) RemoveGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) (err error)
- func (fs *Decomposedfs) RestoreRecycleItem(ctx context.Context, ref *provider.Reference, key, relativePath string, ...) error
- func (fs *Decomposedfs) RestoreRevision(ctx context.Context, ref *provider.Reference, revisionKey string) (returnErr error)
- func (fs *Decomposedfs) SetArbitraryMetadata(ctx context.Context, ref *provider.Reference, md *provider.ArbitraryMetadata) (err error)
- func (fs *Decomposedfs) SetLock(ctx context.Context, ref *provider.Reference, lock *provider.Lock) error
- func (fs *Decomposedfs) Shutdown(ctx context.Context) error
- func (fs *Decomposedfs) TouchFile(ctx context.Context, ref *provider.Reference, markprocessing bool, ...) error
- func (fs *Decomposedfs) Unlock(ctx context.Context, ref *provider.Reference, lock *provider.Lock) error
- func (fs *Decomposedfs) UnsetArbitraryMetadata(ctx context.Context, ref *provider.Reference, keys []string) (err error)
- func (fs *Decomposedfs) UpdateGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error
- func (fs *Decomposedfs) UpdateStorageSpace(ctx context.Context, req *provider.UpdateStorageSpaceRequest) (*provider.UpdateStorageSpaceResponse, error)
- func (fs *Decomposedfs) Upload(ctx context.Context, req storage.UploadRequest, uff storage.UploadFinishedFunc) (provider.ResourceInfo, error)
- func (fs *Decomposedfs) UseIn(composer *tusd.StoreComposer)
- func (fs *Decomposedfs) UserIDToUserAndGroups(ctx context.Context, userid *userv1beta1.UserId) (*userv1beta1.User, error)
- type Session
- type SessionStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns an implementation of the storage.FS interface that talks to a local filesystem.
func NewDefault ¶
NewDefault returns an instance with default components
func ReadSpaceAndNodeFromIndexLink ¶ added in v2.7.1
ReadSpaceAndNodeFromIndexLink reads a symlink and parses space and node id if the link has the correct format, eg: ../../spaces/4c/510ada-c86b-4815-8820-42cdf82c3d51/nodes/4c/51/0a/da/-c86b-4815-8820-42cdf82c3d51 ../../spaces/4c/510ada-c86b-4815-8820-42cdf82c3d51/nodes/4c/51/0a/da/-c86b-4815-8820-42cdf82c3d51.T.2022-02-24T12:35:18.196484592Z
Types ¶
type Decomposedfs ¶
type Decomposedfs struct { UserCache *ttlcache.Cache // contains filtered or unexported fields }
Decomposedfs provides the base for decomposed filesystem implementations
func (*Decomposedfs) AddGrant ¶
func (fs *Decomposedfs) AddGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) (err error)
AddGrant adds a grant to a resource
func (*Decomposedfs) AsConcatableUpload ¶
func (fs *Decomposedfs) AsConcatableUpload(up tusd.Upload) tusd.ConcatableUpload
AsConcatableUpload returns a ConcatableUpload To implement the concatenation extension as specified in https://tus.io/protocols/resumable-upload.html#concatenation the storage needs to implement AsConcatableUpload
func (*Decomposedfs) AsLengthDeclarableUpload ¶
func (fs *Decomposedfs) AsLengthDeclarableUpload(up tusd.Upload) tusd.LengthDeclarableUpload
AsLengthDeclarableUpload returns a LengthDeclarableUpload To implement the creation-defer-length extension as specified in https://tus.io/protocols/resumable-upload.html#creation the storage needs to implement AsLengthDeclarableUpload
func (*Decomposedfs) AsTerminatableUpload ¶
func (fs *Decomposedfs) AsTerminatableUpload(up tusd.Upload) tusd.TerminatableUpload
AsTerminatableUpload returns a TerminatableUpload To implement the termination extension as specified in https://tus.io/protocols/resumable-upload.html#termination the storage needs to implement AsTerminatableUpload
func (*Decomposedfs) CreateHome ¶
func (fs *Decomposedfs) CreateHome(ctx context.Context) (err error)
CreateHome creates a new home node for the given user
func (*Decomposedfs) CreateReference ¶
func (fs *Decomposedfs) CreateReference(ctx context.Context, p string, targetURI *url.URL) (err error)
CreateReference creates a reference as a node folder with the target stored in extended attributes There is no difference between the /Shares folder and normal nodes because the storage is not supposed to be accessible without the storage provider. In effect everything is a shadow namespace. To mimic the eos and owncloud driver we only allow references as children of the "/Shares" folder FIXME: This comment should explain briefly what a reference is in this context.
func (*Decomposedfs) CreateStorageSpace ¶
func (fs *Decomposedfs) CreateStorageSpace(ctx context.Context, req *provider.CreateStorageSpaceRequest) (*provider.CreateStorageSpaceResponse, error)
CreateStorageSpace creates a storage space
func (*Decomposedfs) DeleteRevision ¶ added in v2.13.0
func (fs *Decomposedfs) DeleteRevision(ctx context.Context, ref *provider.Reference, revisionKey string) error
DeleteRevision deletes the specified revision of the resource
func (*Decomposedfs) DeleteStorageSpace ¶
func (fs *Decomposedfs) DeleteStorageSpace(ctx context.Context, req *provider.DeleteStorageSpaceRequest) error
DeleteStorageSpace deletes a storage space
func (*Decomposedfs) DenyGrant ¶
func (fs *Decomposedfs) DenyGrant(ctx context.Context, ref *provider.Reference, grantee *provider.Grantee) error
DenyGrant denies access to a resource.
func (*Decomposedfs) Download ¶
func (fs *Decomposedfs) Download(ctx context.Context, ref *provider.Reference) (io.ReadCloser, error)
Download returns a reader to the specified resource
func (*Decomposedfs) DownloadRevision ¶
func (fs *Decomposedfs) DownloadRevision(ctx context.Context, ref *provider.Reference, revisionKey string) (io.ReadCloser, error)
DownloadRevision returns a reader for the specified revision FIXME the CS3 api should explicitly allow initiating revision and trash download, a related issue is https://github.com/cs3org/reva/issues/1813
func (*Decomposedfs) EmptyRecycle ¶
EmptyRecycle empties the trash
func (*Decomposedfs) GetHome ¶
func (fs *Decomposedfs) GetHome(ctx context.Context) (string, error)
GetHome is called to look up the home path for a user It is NOT supposed to return the internal path but the external path
func (*Decomposedfs) GetLock ¶
func (fs *Decomposedfs) GetLock(ctx context.Context, ref *provider.Reference) (*provider.Lock, error)
GetLock returns an existing lock on the given reference
func (*Decomposedfs) GetMD ¶
func (fs *Decomposedfs) GetMD(ctx context.Context, ref *provider.Reference, mdKeys []string, fieldMask []string) (ri *provider.ResourceInfo, err error)
GetMD returns the metadata for the specified resource
func (*Decomposedfs) GetPathByID ¶
func (fs *Decomposedfs) GetPathByID(ctx context.Context, id *provider.ResourceId) (string, error)
GetPathByID returns the fn pointed by the file id, without the internal namespace
func (*Decomposedfs) GetQuota ¶
func (fs *Decomposedfs) GetQuota(ctx context.Context, ref *provider.Reference) (total uint64, inUse uint64, remaining uint64, err error)
GetQuota returns the quota available TODO Document in the cs3 should we return quota or free space?
func (*Decomposedfs) InitiateUpload ¶
func (fs *Decomposedfs) InitiateUpload(ctx context.Context, ref *provider.Reference, uploadLength int64, metadata map[string]string) (map[string]string, error)
InitiateUpload returns upload ids corresponding to different protocols it supports TODO read optional content for small files in this request TODO InitiateUpload (and Upload) needs a way to receive the expected checksum. Maybe in metadata as 'checksum' => 'sha1 aeosvp45w5xaeoe' = lowercase, space separated?
func (*Decomposedfs) ListFolder ¶
func (fs *Decomposedfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKeys []string, fieldMask []string) ([]*provider.ResourceInfo, error)
ListFolder returns a list of resources in the specified folder
func (*Decomposedfs) ListGrants ¶
func (fs *Decomposedfs) ListGrants(ctx context.Context, ref *provider.Reference) (grants []*provider.Grant, err error)
ListGrants lists the grants on the specified resource
func (*Decomposedfs) ListRecycle ¶
func (fs *Decomposedfs) ListRecycle(ctx context.Context, ref *provider.Reference, key, relativePath string) ([]*provider.RecycleItem, error)
ListRecycle returns the list of available recycle items ref -> the space (= resourceid), key -> deleted node id, relativePath = relative to key
func (*Decomposedfs) ListRevisions ¶
func (fs *Decomposedfs) ListRevisions(ctx context.Context, ref *provider.Reference) (revisions []*provider.FileVersion, err error)
ListRevisions lists the revisions of the given resource
func (*Decomposedfs) ListStorageSpaces ¶
func (fs *Decomposedfs) ListStorageSpaces(ctx context.Context, filter []*provider.ListStorageSpacesRequest_Filter, unrestricted bool) ([]*provider.StorageSpace, error)
ListStorageSpaces returns a list of StorageSpaces. The list can be filtered by space type or space id. Spaces are persisted with symlinks in /spaces/<type>/<spaceid> pointing to ../../nodes/<nodeid>, the root node of the space The spaceid is a concatenation of storageid + "!" + nodeid
func (*Decomposedfs) ListUploadSessions ¶ added in v2.16.4
func (fs *Decomposedfs) ListUploadSessions(ctx context.Context, filter storage.UploadSessionFilter) ([]storage.UploadSession, error)
ListUploadSessions returns the upload sessions for the given filter
func (*Decomposedfs) MustCheckNodePermissions ¶ added in v2.7.3
func (fs *Decomposedfs) MustCheckNodePermissions(ctx context.Context, unrestricted bool) bool
MustCheckNodePermissions checks if permission checks are needed to be performed when user requests spaces
func (*Decomposedfs) Postprocessing ¶ added in v2.13.0
func (fs *Decomposedfs) Postprocessing(ch <-chan events.Event)
Postprocessing starts the postprocessing result collector
func (*Decomposedfs) PurgeRecycleItem ¶
func (fs *Decomposedfs) PurgeRecycleItem(ctx context.Context, ref *provider.Reference, key, relativePath string) error
PurgeRecycleItem purges the specified item, all its children and all their revisions
func (*Decomposedfs) RefreshLock ¶
func (fs *Decomposedfs) RefreshLock(ctx context.Context, ref *provider.Reference, lock *provider.Lock, existingLockID string) error
RefreshLock refreshes an existing lock on the given reference
func (*Decomposedfs) RemoveGrant ¶
func (fs *Decomposedfs) RemoveGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) (err error)
RemoveGrant removes a grant from resource
func (*Decomposedfs) RestoreRecycleItem ¶
func (fs *Decomposedfs) RestoreRecycleItem(ctx context.Context, ref *provider.Reference, key, relativePath string, restoreRef *provider.Reference) error
RestoreRecycleItem restores the specified item
func (*Decomposedfs) RestoreRevision ¶
func (fs *Decomposedfs) RestoreRevision(ctx context.Context, ref *provider.Reference, revisionKey string) (returnErr error)
RestoreRevision restores the specified revision of the resource
func (*Decomposedfs) SetArbitraryMetadata ¶
func (fs *Decomposedfs) SetArbitraryMetadata(ctx context.Context, ref *provider.Reference, md *provider.ArbitraryMetadata) (err error)
SetArbitraryMetadata sets the metadata on a resource
func (*Decomposedfs) SetLock ¶
func (fs *Decomposedfs) SetLock(ctx context.Context, ref *provider.Reference, lock *provider.Lock) error
SetLock puts a lock on the given reference
func (*Decomposedfs) Shutdown ¶
func (fs *Decomposedfs) Shutdown(ctx context.Context) error
Shutdown shuts down the storage
func (*Decomposedfs) TouchFile ¶
func (fs *Decomposedfs) TouchFile(ctx context.Context, ref *provider.Reference, markprocessing bool, mtime string) error
TouchFile as defined in the storage.FS interface
func (*Decomposedfs) Unlock ¶
func (fs *Decomposedfs) Unlock(ctx context.Context, ref *provider.Reference, lock *provider.Lock) error
Unlock removes an existing lock from the given reference
func (*Decomposedfs) UnsetArbitraryMetadata ¶
func (fs *Decomposedfs) UnsetArbitraryMetadata(ctx context.Context, ref *provider.Reference, keys []string) (err error)
UnsetArbitraryMetadata unsets the metadata on the given resource
func (*Decomposedfs) UpdateGrant ¶
func (fs *Decomposedfs) UpdateGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error
UpdateGrant updates a grant on a resource TODO remove AddGrant or UpdateGrant grant from CS3 api, redundant? tracked in https://github.com/cs3org/cs3apis/issues/92
func (*Decomposedfs) UpdateStorageSpace ¶
func (fs *Decomposedfs) UpdateStorageSpace(ctx context.Context, req *provider.UpdateStorageSpaceRequest) (*provider.UpdateStorageSpaceResponse, error)
UpdateStorageSpace updates a storage space
func (*Decomposedfs) Upload ¶
func (fs *Decomposedfs) Upload(ctx context.Context, req storage.UploadRequest, uff storage.UploadFinishedFunc) (provider.ResourceInfo, error)
Upload uploads data to the given resource TODO Upload (and InitiateUpload) needs a way to receive the expected checksum. Maybe in metadata as 'checksum' => 'sha1 aeosvp45w5xaeoe' = lowercase, space separated?
func (*Decomposedfs) UseIn ¶
func (fs *Decomposedfs) UseIn(composer *tusd.StoreComposer)
UseIn tells the tus upload middleware which extensions it supports.
func (*Decomposedfs) UserIDToUserAndGroups ¶ added in v2.13.0
func (fs *Decomposedfs) UserIDToUserAndGroups(ctx context.Context, userid *userv1beta1.UserId) (*userv1beta1.User, error)
UserIDToUserAndGroups converts a user ID to a user with groups
type Session ¶ added in v2.18.0
Session is the interface that OcisSession implements. By combining tus.Upload, storage.UploadSession and custom functions we can reuse the same struct throughout the whole upload lifecycle.
Some functions that are only used by decomposedfs are not yet part of this interface. They might be added after more refactoring.
type SessionStore ¶ added in v2.18.0
type SessionStore interface { New(ctx context.Context) *upload.OcisSession List(ctx context.Context) ([]*upload.OcisSession, error) Get(ctx context.Context, id string) (*upload.OcisSession, error) Cleanup(ctx context.Context, session upload.Session, revertNodeMetadata, keepUpload, unmarkPostprocessing bool) }