github.com/cs3org/reva/v2@v2.27.7/pkg/storage/fs/hello/unimplemented.go (about)

     1  // Copyright 2018-2021 CERN
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  //
    15  // In applying this license, CERN does not waive the privileges and immunities
    16  // granted to it by virtue of its status as an Intergovernmental Organization
    17  // or submit itself to any jurisdiction.
    18  
    19  package hello
    20  
    21  import (
    22  	"context"
    23  	"io"
    24  	"net/url"
    25  
    26  	provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
    27  
    28  	"github.com/cs3org/reva/v2/pkg/errtypes"
    29  	"github.com/cs3org/reva/v2/pkg/storage"
    30  )
    31  
    32  // hellofs is readonly so these remain unimplemented
    33  
    34  // CreateReference creates a resource of type reference
    35  func (fs *hellofs) CreateReference(ctx context.Context, path string, targetURI *url.URL) error {
    36  	return errtypes.NotSupported("unimplemented")
    37  }
    38  
    39  // CreateStorageSpace creates a storage space
    40  func (fs *hellofs) CreateStorageSpace(ctx context.Context, req *provider.CreateStorageSpaceRequest) (*provider.CreateStorageSpaceResponse, error) {
    41  	return nil, errtypes.NotSupported("unimplemented: CreateStorageSpace")
    42  }
    43  
    44  // UpdateStorageSpace updates a storage space
    45  func (fs *hellofs) UpdateStorageSpace(ctx context.Context, req *provider.UpdateStorageSpaceRequest) (*provider.UpdateStorageSpaceResponse, error) {
    46  	return nil, errtypes.NotSupported("update storage space")
    47  }
    48  
    49  // DeleteStorageSpace deletes a storage space
    50  func (fs *hellofs) DeleteStorageSpace(ctx context.Context, req *provider.DeleteStorageSpaceRequest) error {
    51  	return errtypes.NotSupported("delete storage space")
    52  }
    53  
    54  // CreateDir creates a resource of type container
    55  func (fs *hellofs) CreateDir(ctx context.Context, ref *provider.Reference) error {
    56  	return errtypes.NotSupported("unimplemented")
    57  }
    58  
    59  // TouchFile sets the mtime of a resource, creating an empty file if it does not exist
    60  // FIXME the markprocessing flag is an implementation detail of decomposedfs, remove it from the function
    61  // FIXME the mtime should either be a time.Time or a CS3 Timestamp, not a string
    62  func (fs *hellofs) TouchFile(ctx context.Context, ref *provider.Reference, _ bool, _ string) error {
    63  	return errtypes.NotSupported("unimplemented")
    64  }
    65  
    66  // Delete deletes a resource.
    67  // If the storage driver supports a recycle bin it should moves it to the recycle bin
    68  func (fs *hellofs) Delete(ctx context.Context, ref *provider.Reference) error {
    69  	return errtypes.NotSupported("unimplemented")
    70  }
    71  
    72  // Move changes the path of a resource
    73  func (fs *hellofs) Move(ctx context.Context, oldRef, newRef *provider.Reference) error {
    74  	return errtypes.NotSupported("unimplemented")
    75  }
    76  
    77  // Upload creates or updates a resource of type file with a new revision
    78  func (fs *hellofs) Upload(ctx context.Context, req storage.UploadRequest, uff storage.UploadFinishedFunc) (*provider.ResourceInfo, error) {
    79  	return nil, errtypes.NotSupported("hellofs: upload not supported")
    80  }
    81  
    82  // InitiateUpload returns a list of protocols with urls that can be used to append bytes to a new upload session
    83  func (fs *hellofs) InitiateUpload(ctx context.Context, ref *provider.Reference, uploadLength int64, metadata map[string]string) (map[string]string, error) {
    84  	return nil, errtypes.NotSupported("hellofs: initiate upload not supported")
    85  }
    86  
    87  // grants
    88  
    89  // DenyGrant marks a resource as denied for a recipient
    90  // The resource and its children must be completely hidden for the recipient
    91  func (fs *hellofs) DenyGrant(ctx context.Context, ref *provider.Reference, g *provider.Grantee) error {
    92  	return errtypes.NotSupported("hellofs: deny grant not supported")
    93  }
    94  
    95  // AddGrant adds a grant to a resource
    96  func (fs *hellofs) AddGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error {
    97  	return errtypes.NotSupported("unimplemented")
    98  }
    99  
   100  // ListGrants lists all grants on a resource
   101  func (fs *hellofs) ListGrants(ctx context.Context, ref *provider.Reference) ([]*provider.Grant, error) {
   102  	return nil, errtypes.NotSupported("unimplemented")
   103  }
   104  
   105  // RemoveGrant removes a grant from a resource
   106  func (fs *hellofs) RemoveGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error {
   107  	return errtypes.NotSupported("unimplemented")
   108  }
   109  
   110  // UpdateGrant updates a grant on a resource
   111  func (fs *hellofs) UpdateGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error {
   112  	return errtypes.NotSupported("unimplemented")
   113  }
   114  
   115  // arbitrary metadata
   116  
   117  // SetArbitraryMetadata sets arbitraty metadata on a resource
   118  func (fs *hellofs) SetArbitraryMetadata(ctx context.Context, ref *provider.Reference, md *provider.ArbitraryMetadata) error {
   119  	return errtypes.NotSupported("unimplemented")
   120  }
   121  
   122  // UnsetArbitraryMetadata removes arbitraty metadata from a resource
   123  func (fs *hellofs) UnsetArbitraryMetadata(ctx context.Context, ref *provider.Reference, keys []string) error {
   124  	return errtypes.NotSupported("unimplemented")
   125  }
   126  
   127  // locks
   128  
   129  // GetLock returns an existing lock on the given reference
   130  func (fs *hellofs) GetLock(ctx context.Context, ref *provider.Reference) (*provider.Lock, error) {
   131  	return nil, errtypes.NotSupported("unimplemented")
   132  }
   133  
   134  // SetLock puts a lock on the given reference
   135  func (fs *hellofs) SetLock(ctx context.Context, ref *provider.Reference, lock *provider.Lock) error {
   136  	return errtypes.NotSupported("unimplemented")
   137  }
   138  
   139  // RefreshLock refreshes an existing lock on the given reference
   140  func (fs *hellofs) RefreshLock(ctx context.Context, ref *provider.Reference, lock *provider.Lock, existingLockID string) error {
   141  	return errtypes.NotSupported("unimplemented")
   142  }
   143  
   144  // Unlock removes an existing lock from the given reference
   145  func (fs *hellofs) Unlock(ctx context.Context, ref *provider.Reference, lock *provider.Lock) error {
   146  	return errtypes.NotSupported("unimplemented")
   147  }
   148  
   149  // revisions
   150  
   151  // ListRevisions lists all revisions for the referenced resource
   152  func (fs *hellofs) ListRevisions(ctx context.Context, ref *provider.Reference) ([]*provider.FileVersion, error) {
   153  	return nil, errtypes.NotSupported("unimplemented")
   154  }
   155  
   156  // DownloadRevision downloads a revision
   157  func (fs *hellofs) DownloadRevision(ctx context.Context, ref *provider.Reference, revisionKey string, openReaderFunc func(md *provider.ResourceInfo) bool) (*provider.ResourceInfo, io.ReadCloser, error) {
   158  	return nil, nil, errtypes.NotSupported("unimplemented")
   159  }
   160  
   161  // RestoreRevision restores a revision
   162  func (fs *hellofs) RestoreRevision(ctx context.Context, ref *provider.Reference, revisionKey string) error {
   163  	return errtypes.NotSupported("unimplemented")
   164  }
   165  
   166  // trash
   167  
   168  // PurgeRecycleItem removes a resource from the recycle bin
   169  func (fs *hellofs) PurgeRecycleItem(ctx context.Context, ref *provider.Reference, key, relativePath string) error {
   170  	return errtypes.NotSupported("unimplemented")
   171  }
   172  
   173  // EmptyRecycle removes all resource from the recycle bin
   174  func (fs *hellofs) EmptyRecycle(ctx context.Context, ref *provider.Reference) error {
   175  	return errtypes.NotSupported("unimplemented")
   176  }
   177  
   178  // ListRecycle lists the content of the recycle bin
   179  func (fs *hellofs) ListRecycle(ctx context.Context, ref *provider.Reference, key, relativePath string) ([]*provider.RecycleItem, error) {
   180  	return nil, errtypes.NotSupported("unimplemented")
   181  }
   182  
   183  // RestoreRecycleItem restores an item from the recyle bin
   184  // if restoreRef is nil the resource should be restored at the original path
   185  func (fs *hellofs) RestoreRecycleItem(ctx context.Context, ref *provider.Reference, key, relativePath string, restoreRef *provider.Reference) error {
   186  	return errtypes.NotSupported("unimplemented")
   187  }
   188  
   189  // CreateHome creates a users home
   190  // Deprecated: use CreateStorageSpace with type personal
   191  func (fs *hellofs) CreateHome(ctx context.Context) error {
   192  	return errtypes.NotSupported("unimplemented")
   193  }
   194  
   195  // GetHome returns the path to the users home
   196  // Deprecated: use ListStorageSpaces with type personal
   197  func (fs *hellofs) GetHome(ctx context.Context) (string, error) {
   198  	return "", errtypes.NotSupported("unimplemented")
   199  }