github.com/scaleoutsean/fusego@v0.0.0-20220224074057-4a6429e46bb8/fuseutil/not_implemented_file_system.go (about)

     1  // Copyright 2015 Google Inc. All Rights Reserved.
     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  package fuseutil
    16  
    17  import (
    18  	"context"
    19  
    20  	"github.com/scaleoutsean/fusego"
    21  	"github.com/scaleoutsean/fusego/fuseops"
    22  )
    23  
    24  // A FileSystem that responds to all ops with fuse.ENOSYS. Embed this in your
    25  // struct to inherit default implementations for the methods you don't care
    26  // about, ensuring your struct will continue to implement FileSystem even as
    27  // new methods are added.
    28  type NotImplementedFileSystem struct {
    29  }
    30  
    31  var _ FileSystem = &NotImplementedFileSystem{}
    32  
    33  func (fs *NotImplementedFileSystem) StatFS(
    34  	ctx context.Context,
    35  	op *fuseops.StatFSOp) error {
    36  	return fuse.ENOSYS
    37  }
    38  
    39  func (fs *NotImplementedFileSystem) LookUpInode(
    40  	ctx context.Context,
    41  	op *fuseops.LookUpInodeOp) error {
    42  	return fuse.ENOSYS
    43  }
    44  
    45  func (fs *NotImplementedFileSystem) GetInodeAttributes(
    46  	ctx context.Context,
    47  	op *fuseops.GetInodeAttributesOp) error {
    48  	return fuse.ENOSYS
    49  }
    50  
    51  func (fs *NotImplementedFileSystem) SetInodeAttributes(
    52  	ctx context.Context,
    53  	op *fuseops.SetInodeAttributesOp) error {
    54  	return fuse.ENOSYS
    55  }
    56  
    57  func (fs *NotImplementedFileSystem) ForgetInode(
    58  	ctx context.Context,
    59  	op *fuseops.ForgetInodeOp) error {
    60  	return fuse.ENOSYS
    61  }
    62  
    63  func (fs *NotImplementedFileSystem) MkDir(
    64  	ctx context.Context,
    65  	op *fuseops.MkDirOp) error {
    66  	return fuse.ENOSYS
    67  }
    68  
    69  func (fs *NotImplementedFileSystem) MkNode(
    70  	ctx context.Context,
    71  	op *fuseops.MkNodeOp) error {
    72  	return fuse.ENOSYS
    73  }
    74  
    75  func (fs *NotImplementedFileSystem) CreateFile(
    76  	ctx context.Context,
    77  	op *fuseops.CreateFileOp) error {
    78  	return fuse.ENOSYS
    79  }
    80  
    81  func (fs *NotImplementedFileSystem) CreateSymlink(
    82  	ctx context.Context,
    83  	op *fuseops.CreateSymlinkOp) error {
    84  	return fuse.ENOSYS
    85  }
    86  
    87  func (fs *NotImplementedFileSystem) CreateLink(
    88  	ctx context.Context,
    89  	op *fuseops.CreateLinkOp) error {
    90  	return fuse.ENOSYS
    91  }
    92  
    93  func (fs *NotImplementedFileSystem) Rename(
    94  	ctx context.Context,
    95  	op *fuseops.RenameOp) error {
    96  	return fuse.ENOSYS
    97  }
    98  
    99  func (fs *NotImplementedFileSystem) RmDir(
   100  	ctx context.Context,
   101  	op *fuseops.RmDirOp) error {
   102  	return fuse.ENOSYS
   103  }
   104  
   105  func (fs *NotImplementedFileSystem) Unlink(
   106  	ctx context.Context,
   107  	op *fuseops.UnlinkOp) error {
   108  	return fuse.ENOSYS
   109  }
   110  
   111  func (fs *NotImplementedFileSystem) OpenDir(
   112  	ctx context.Context,
   113  	op *fuseops.OpenDirOp) error {
   114  	return fuse.ENOSYS
   115  }
   116  
   117  func (fs *NotImplementedFileSystem) ReadDir(
   118  	ctx context.Context,
   119  	op *fuseops.ReadDirOp) error {
   120  	return fuse.ENOSYS
   121  }
   122  
   123  func (fs *NotImplementedFileSystem) ReleaseDirHandle(
   124  	ctx context.Context,
   125  	op *fuseops.ReleaseDirHandleOp) error {
   126  	return fuse.ENOSYS
   127  }
   128  
   129  func (fs *NotImplementedFileSystem) OpenFile(
   130  	ctx context.Context,
   131  	op *fuseops.OpenFileOp) error {
   132  	return fuse.ENOSYS
   133  }
   134  
   135  func (fs *NotImplementedFileSystem) ReadFile(
   136  	ctx context.Context,
   137  	op *fuseops.ReadFileOp) error {
   138  	return fuse.ENOSYS
   139  }
   140  
   141  func (fs *NotImplementedFileSystem) WriteFile(
   142  	ctx context.Context,
   143  	op *fuseops.WriteFileOp) error {
   144  	return fuse.ENOSYS
   145  }
   146  
   147  func (fs *NotImplementedFileSystem) SyncFile(
   148  	ctx context.Context,
   149  	op *fuseops.SyncFileOp) error {
   150  	return fuse.ENOSYS
   151  }
   152  
   153  func (fs *NotImplementedFileSystem) FlushFile(
   154  	ctx context.Context,
   155  	op *fuseops.FlushFileOp) error {
   156  	return fuse.ENOSYS
   157  }
   158  
   159  func (fs *NotImplementedFileSystem) ReleaseFileHandle(
   160  	ctx context.Context,
   161  	op *fuseops.ReleaseFileHandleOp) error {
   162  	return fuse.ENOSYS
   163  }
   164  
   165  func (fs *NotImplementedFileSystem) ReadSymlink(
   166  	ctx context.Context,
   167  	op *fuseops.ReadSymlinkOp) error {
   168  	return fuse.ENOSYS
   169  }
   170  
   171  func (fs *NotImplementedFileSystem) RemoveXattr(
   172  	ctx context.Context,
   173  	op *fuseops.RemoveXattrOp) error {
   174  	return fuse.ENOSYS
   175  }
   176  
   177  func (fs *NotImplementedFileSystem) GetXattr(
   178  	ctx context.Context,
   179  	op *fuseops.GetXattrOp) error {
   180  	return fuse.ENOSYS
   181  }
   182  
   183  func (fs *NotImplementedFileSystem) ListXattr(
   184  	ctx context.Context,
   185  	op *fuseops.ListXattrOp) error {
   186  	return fuse.ENOSYS
   187  }
   188  
   189  func (fs *NotImplementedFileSystem) SetXattr(
   190  	ctx context.Context,
   191  	op *fuseops.SetXattrOp) error {
   192  	return fuse.ENOSYS
   193  }
   194  
   195  func (fs *NotImplementedFileSystem) Fallocate(
   196  	ctx context.Context,
   197  	op *fuseops.FallocateOp) error {
   198  	return fuse.ENOSYS
   199  }
   200  
   201  func (fs *NotImplementedFileSystem) Destroy() {
   202  }