|
@@ -0,0 +1,112 @@
|
|
|
+package sharefs
|
|
|
+
|
|
|
+import (
|
|
|
+ "errors"
|
|
|
+ "io"
|
|
|
+ "os"
|
|
|
+ "path/filepath"
|
|
|
+ "time"
|
|
|
+)
|
|
|
+
|
|
|
+/*
|
|
|
+ filesystemAbstraction.go
|
|
|
+
|
|
|
+ This file contains all the abstraction funtion of a local file system.
|
|
|
+
|
|
|
+*/
|
|
|
+
|
|
|
+type ShareFileSystemAbstraction struct {
|
|
|
+}
|
|
|
+
|
|
|
+func NewShareFileSystemAbstraction() ShareFileSystemAbstraction {
|
|
|
+ return ShareFileSystemAbstraction{}
|
|
|
+}
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) Chmod(filename string, mode os.FileMode) error {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) Chown(filename string, uid int, gid int) error {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) Chtimes(filename string, atime time.Time, mtime time.Time) error {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) Create(filename string) (*os.File, error) {
|
|
|
+ return nil, nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) Mkdir(filename string, mode os.FileMode) error {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) MkdirAll(filename string, mode os.FileMode) error {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) Name() string {
|
|
|
+ return ""
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) Open(filename string) (*os.File, error) {
|
|
|
+ return nil, nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) OpenFile(filename string, flag int, perm os.FileMode) (*os.File, error) {
|
|
|
+ return nil, nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) Remove(filename string) error {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) RemoveAll(path string) error {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) Rename(oldname, newname string) error {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) Stat(filename string) (os.FileInfo, error) {
|
|
|
+ return nil, nil
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ Abstraction Utilities
|
|
|
+*/
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) VirtualPathToRealPath(subpath string, username string) (string, error) {
|
|
|
+ return "", errors.New("SHAREFS WORK IN PROGRESS")
|
|
|
+}
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) RealPathToVirtualPath(fullpath string, username string) (string, error) {
|
|
|
+ return "", errors.New("SHAREFS WORK IN PROGRESS")
|
|
|
+}
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) FileExists(realpath string) bool {
|
|
|
+ return false
|
|
|
+}
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) IsDir(realpath string) bool {
|
|
|
+ return false
|
|
|
+}
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) Glob(realpathWildcard string) ([]string, error) {
|
|
|
+ return []string{}, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) GetFileSize(realpath string) int64 {
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) GetModTime(realpath string) (int64, error) {
|
|
|
+ return 0, errors.New("empty filesystem abstraction")
|
|
|
+}
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) WriteFile(filename string, content []byte, mode os.FileMode) error {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) ReadFile(filename string) ([]byte, error) {
|
|
|
+ return []byte(""), errors.New("empty filesystem abstraction")
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) WriteStream(filename string, stream io.Reader, mode os.FileMode) error {
|
|
|
+ return errors.New("operation not supported on dummy file system")
|
|
|
+}
|
|
|
+func (l ShareFileSystemAbstraction) ReadStream(filename string) (io.ReadCloser, error) {
|
|
|
+ return nil, errors.New("operation not supported on dummy file system")
|
|
|
+}
|
|
|
+
|
|
|
+func (l ShareFileSystemAbstraction) Walk(root string, walkFn filepath.WalkFunc) error {
|
|
|
+ return errors.New("empty filesystem abstraction")
|
|
|
+}
|