go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/os/fsutil/nofs.go (about) 1 // Copyright (c) Mondoo, Inc. 2 // SPDX-License-Identifier: BUSL-1.1 3 4 package fsutil 5 6 import ( 7 "errors" 8 "os" 9 "time" 10 11 "github.com/spf13/afero" 12 ) 13 14 type NoFs struct{} 15 16 var notImplementedError = errors.New("not implemented") 17 18 func (NoFs) Create(name string) (afero.File, error) { 19 return nil, notImplementedError 20 } 21 22 func (NoFs) Mkdir(name string, perm os.FileMode) error { 23 return notImplementedError 24 } 25 26 func (NoFs) MkdirAll(path string, perm os.FileMode) error { 27 return notImplementedError 28 } 29 30 func (NoFs) Open(name string) (afero.File, error) { 31 return nil, notImplementedError 32 } 33 34 func (NoFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error) { 35 return nil, notImplementedError 36 } 37 38 func (NoFs) Remove(name string) error { 39 return notImplementedError 40 } 41 42 func (NoFs) RemoveAll(path string) error { 43 return notImplementedError 44 } 45 46 func (NoFs) Rename(oldname, newname string) error { 47 return notImplementedError 48 } 49 50 func (NoFs) Stat(name string) (os.FileInfo, error) { 51 return nil, notImplementedError 52 } 53 54 func (NoFs) Name() string { 55 return "nofs" 56 } 57 58 func (NoFs) Chmod(name string, mode os.FileMode) error { 59 return notImplementedError 60 } 61 62 func (NoFs) Chtimes(name string, atime time.Time, mtime time.Time) error { 63 return notImplementedError 64 } 65 66 func (NoFs) Chown(name string, uid, gid int) error { 67 return notImplementedError 68 }