commands

package
v0.0.0-...-1a6bc1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2017 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SharedLock = iota
	ExclusiveLock
)

Types of locks

View Source
const PERM_MASK = 0777

Variables

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

func GetFileSystemLock(paranoidDir string, lockType int) error

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, ip, port, 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, returnError error, fileContents []byte)

ReadCommand reads data from a file

func ReadDirCommand

func ReadDirCommand(paranoidDirectory, dirPath string) (returnCode returncodes.Code, returnError error, fileNames []string)

ReadDirCommand returns a list of all the files in the given paranoidDirectory

func ReadlinkCommand

func ReadlinkCommand(paranoidDirectory, filePath string) (returnCode returncodes.Code, returnError error, linkContents string)

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 StatCommand

func StatCommand(paranoidDirectory, filePath string) (returnCode returncodes.Code, returnError error, info statInfo)

StatCommand returns information about a file as statInfo object

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

func UnLockFileSystem(paranoidDir string) error

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, returnError error, bytesWrote int)

WriteCommand writes data to the given file

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL