Documentation ¶
Index ¶
- Variables
- func GetFuseReturnCode(retcode returncodes.Code) fuse.Status
- func StartPfi(logVerbose bool)
- type ParanoidFile
- func (f *ParanoidFile) Chmod(perms uint32) fuse.Status
- func (f *ParanoidFile) Read(buf []byte, off int64) (fuse.ReadResult, fuse.Status)
- func (f *ParanoidFile) Truncate(size uint64) fuse.Status
- func (f *ParanoidFile) Utimens(atime *time.Time, mtime *time.Time) fuse.Status
- func (f *ParanoidFile) Write(content []byte, off int64) (uint32, fuse.Status)
- type ParanoidFileSystem
- func (fs *ParanoidFileSystem) Access(name string, mode uint32, context *fuse.Context) fuse.Status
- func (fs *ParanoidFileSystem) Chmod(name string, perms uint32, context *fuse.Context) fuse.Status
- func (fs *ParanoidFileSystem) Create(name string, flags uint32, mode uint32, context *fuse.Context) (nodefs.File, fuse.Status)
- func (fs *ParanoidFileSystem) GetAttr(name string, context *fuse.Context) (*fuse.Attr, fuse.Status)
- func (fs *ParanoidFileSystem) Link(oldName string, newName string, context *fuse.Context) fuse.Status
- func (fs *ParanoidFileSystem) Mkdir(name string, mode uint32, context *fuse.Context) fuse.Status
- func (fs *ParanoidFileSystem) Open(name string, flags uint32, context *fuse.Context) (nodefs.File, fuse.Status)
- func (fs *ParanoidFileSystem) OpenDir(name string, context *fuse.Context) ([]fuse.DirEntry, fuse.Status)
- func (fs *ParanoidFileSystem) Readlink(name string, context *fuse.Context) (string, fuse.Status)
- func (fs *ParanoidFileSystem) Rename(oldName string, newName string, context *fuse.Context) fuse.Status
- func (fs *ParanoidFileSystem) Rmdir(name string, context *fuse.Context) fuse.Status
- func (fs *ParanoidFileSystem) Symlink(oldName string, newName string, context *fuse.Context) fuse.Status
- func (fs *ParanoidFileSystem) Truncate(name string, size uint64, context *fuse.Context) fuse.Status
- func (fs *ParanoidFileSystem) Unlink(name string, context *fuse.Context) fuse.Status
- func (fs *ParanoidFileSystem) Utimens(name string, atime *time.Time, mtime *time.Time, context *fuse.Context) fuse.Status
Constants ¶
This section is empty.
Variables ¶
var ( SendOverNetwork bool Log *logger.ParanoidLogger )
Functions ¶
func GetFuseReturnCode ¶
func GetFuseReturnCode(retcode returncodes.Code) fuse.Status
Types ¶
type ParanoidFile ¶
ParanoidFile is a custom file struct with read and write functions
func (*ParanoidFile) Chmod ¶
func (f *ParanoidFile) Chmod(perms uint32) fuse.Status
Chmod changes the permission flags of the file
func (*ParanoidFile) Read ¶
func (f *ParanoidFile) Read(buf []byte, off int64) (fuse.ReadResult, fuse.Status)
Read reads a file and returns an array of bytes
func (*ParanoidFile) Truncate ¶
func (f *ParanoidFile) Truncate(size uint64) fuse.Status
Truncate is called when a file is to be reduced in length to size.
type ParanoidFileSystem ¶
type ParanoidFileSystem struct {
pathfs.FileSystem
}
ParanoidFileSystem is the struct which holds all the custom filesystem functions pp2p provides
func (*ParanoidFileSystem) Access ¶
Access is called by fuse to see if it has access to a certain file
func (*ParanoidFileSystem) Create ¶
func (fs *ParanoidFileSystem) Create(name string, flags uint32, mode uint32, context *fuse.Context) (nodefs.File, fuse.Status)
Create is called when a new file is to be created.
func (*ParanoidFileSystem) GetAttr ¶
GetAttr is called by fuse when the attributes of a file or directory are needed. (pfs stat)
func (*ParanoidFileSystem) Link ¶
func (fs *ParanoidFileSystem) Link(oldName string, newName string, context *fuse.Context) fuse.Status
Link creates a hard link from newName to oldName
func (*ParanoidFileSystem) Open ¶
func (fs *ParanoidFileSystem) Open(name string, flags uint32, context *fuse.Context) (nodefs.File, fuse.Status)
Open is called to get a custom file object for a certain file so that Read and Write (among others) opperations can be executed on this custom file object (ParanoidFile, see below)
func (*ParanoidFileSystem) OpenDir ¶
func (fs *ParanoidFileSystem) OpenDir(name string, context *fuse.Context) ([]fuse.DirEntry, fuse.Status)
OpenDir is called when the contents of a directory are needed.
func (*ParanoidFileSystem) Rename ¶
func (fs *ParanoidFileSystem) Rename(oldName string, newName string, context *fuse.Context) fuse.Status
Rename is called when renaming a file
func (*ParanoidFileSystem) Symlink ¶
func (fs *ParanoidFileSystem) Symlink(oldName string, newName string, context *fuse.Context) fuse.Status
Symlink creates a symbolic link from newName to oldName
func (*ParanoidFileSystem) Truncate ¶
Truncate is called when a file is to be reduced in length to size.