Documentation ¶
Index ¶
- Constants
- func AccessCommand(paranoidDirectory, filePath string, mode uint32) (returnCode returncodes.Code, returnError error)
- func ChmodCommand(paranoidDirectory, filePath string, perms os.FileMode) (returnCode returncodes.Code, returnError error)
- func CreatCommand(paranoidDirectory, filePath string, perms os.FileMode) (returnCode returncodes.Code, returnError error)
- func GetFileSystemLock(paranoidDir string, lockType int) error
- func InitCommand(directory string) (returnCode returncodes.Code, returnError error)
- func LinkCommand(paranoidDirectory, existingFilePath, targetFilePath string) (returnCode returncodes.Code, returnError error)
- func MkdirCommand(paranoidDirectory, dirPath string, mode os.FileMode) (returnCode returncodes.Code, returnError error)
- func MountCommand(paranoidDirectory, dAddr, mountPoint string) (returnCode returncodes.Code, returnError error)
- func ReadCommand(paranoidDirectory, filePath string, offset, length int64) (returnCode returncodes.Code, fileContents []byte, returnError error)
- func ReadDirCommand(paranoidDirectory, dirPath string) (returnCode returncodes.Code, fileNames []string, returnError error)
- func ReadlinkCommand(paranoidDirectory, filePath string) (returnCode returncodes.Code, linkContents string, returnError error)
- func RenameCommand(paranoidDirectory, oldFilePath, newFilePath string) (returnCode returncodes.Code, returnError error)
- func RmdirCommand(paranoidDirectory, dirPath string) (returnCode returncodes.Code, returnError error)
- func SymlinkCommand(paranoidDirectory, existingFilePath, targetFilePath string) (returnCode returncodes.Code, returnError error)
- func TruncateCommand(paranoidDirectory, filePath string, length int64) (returnCode returncodes.Code, returnError error)
- func UnLockFileSystem(paranoidDir string) error
- func UnlinkCommand(paranoidDirectory, filePath string) (returnCode returncodes.Code, returnError error)
- func UtimesCommand(paranoidDirectory, filePath string, atime, mtime *time.Time) (returnCode returncodes.Code, returnError error)
- func WriteCommand(paranoidDirectory, filePath string, offset, length int64, data []byte) (returnCode returncodes.Code, bytesWrote int, returnError error)
- type StatInfo
Constants ¶
const ( ExclusiveLock )
Types of locks
const PermMask = 0777
PermMask is the default mask used for permissions
Variables ¶
This section is empty.
Functions ¶
func AccessCommand ¶
func AccessCommand( paranoidDirectory, filePath string, mode uint32, ) (returnCode returncodes.Code, returnError error)
AccessCommand is used by fuse to check if it has access to a given file.
func ChmodCommand ¶
func ChmodCommand( paranoidDirectory, filePath string, perms os.FileMode, ) (returnCode returncodes.Code, returnError error)
ChmodCommand is used to change the permissions of a file.
func CreatCommand ¶
func CreatCommand( paranoidDirectory, filePath string, perms os.FileMode, ) (returnCode returncodes.Code, returnError error)
CreatCommand creates a new file with the name filePath in the pfs paranoidDirectory
func GetFileSystemLock ¶
GetFileSystemLock locks the filesystem
func InitCommand ¶
func InitCommand(directory string) (returnCode returncodes.Code, returnError error)
InitCommand creates the pvd directory sturucture It also gets a UUID and stores it in the meta directory.
func LinkCommand ¶
func LinkCommand( paranoidDirectory, existingFilePath, targetFilePath string, ) (returnCode returncodes.Code, returnError error)
LinkCommand creates a link of a file.
func MkdirCommand ¶
func MkdirCommand( paranoidDirectory, dirPath string, mode os.FileMode, ) (returnCode returncodes.Code, returnError error)
MkdirCommand is called when making a paranoidDirectory
func MountCommand ¶
func MountCommand( paranoidDirectory, dAddr, mountPoint string, ) (returnCode returncodes.Code, returnError error)
MountCommand is used to notify a pfs paranoidDirectory it has been mounted.
func ReadCommand ¶
func ReadCommand( paranoidDirectory, filePath string, offset, length int64, ) (returnCode returncodes.Code, fileContents []byte, returnError error)
ReadCommand reads data from a file
func ReadDirCommand ¶
func ReadDirCommand( paranoidDirectory, dirPath string, ) (returnCode returncodes.Code, fileNames []string, returnError error)
ReadDirCommand returns a list of all the files in the given paranoidDirectory
func ReadlinkCommand ¶
func ReadlinkCommand( paranoidDirectory, filePath string, ) (returnCode returncodes.Code, linkContents string, returnError error)
ReadlinkCommand reads the value of the symbolic link
func RenameCommand ¶
func RenameCommand( paranoidDirectory, oldFilePath, newFilePath string, ) (returnCode returncodes.Code, returnError error)
RenameCommand is called when renaming a file
func RmdirCommand ¶
func RmdirCommand( paranoidDirectory, dirPath string, ) (returnCode returncodes.Code, returnError error)
RmdirCommand removes a paranoidDirectory
func SymlinkCommand ¶
func SymlinkCommand( paranoidDirectory, existingFilePath, targetFilePath string, ) (returnCode returncodes.Code, returnError error)
SymlinkCommand creates a symbolic link
func TruncateCommand ¶
func TruncateCommand( paranoidDirectory, filePath string, length int64, ) (returnCode returncodes.Code, returnError error)
TruncateCommand reduces the file given to the new length
func UnLockFileSystem ¶
UnLockFileSystem removes the lock from the filesystem
func UnlinkCommand ¶
func UnlinkCommand( paranoidDirectory, filePath string, ) (returnCode returncodes.Code, returnError error)
UnlinkCommand removes a filename link from an inode.
func UtimesCommand ¶
func UtimesCommand( paranoidDirectory, filePath string, atime, mtime *time.Time, ) (returnCode returncodes.Code, returnError error)
UtimesCommand updates the acess time and modified time of a file
func WriteCommand ¶
func WriteCommand( paranoidDirectory, filePath string, offset, length int64, data []byte, ) (returnCode returncodes.Code, bytesWrote int, returnError error)
WriteCommand writes data to the given file
Types ¶
type StatInfo ¶
type StatInfo struct { Length int64 Ctime time.Time Mtime time.Time Atime time.Time Mode os.FileMode }
StatInfo contains the file metadata
func StatCommand ¶
func StatCommand( paranoidDirectory, filePath string, ) (returnCode returncodes.Code, info StatInfo, returnError error)
StatCommand returns information about a file as StatInfo object