Documentation
¶
Index ¶
- Constants
- func IsSymlinkStoredName(storedName string) bool
- func SymlinkStoredName(visibleName string) string
- func SymlinkVisibleName(storedName string) (string, bool)
- type Dir
- func (dir *Dir) Create(ctx context.Context, name string, flags uint32, mode uint32, ...) (*fusefs.Inode, fusefs.FileHandle, uint32, syscall.Errno)
- func (dir *Dir) Fsync(ctx context.Context, fh fusefs.FileHandle, flags uint32) syscall.Errno
- func (dir *Dir) Getattr(ctx context.Context, fh fusefs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (dir *Dir) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)
- func (dir *Dir) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)
- func (dir *Dir) NewSubDirInode(ctx context.Context, inodeID uint64, path string) (*Dir, *fusefs.Inode)
- func (dir *Dir) NewSubFileInode(ctx context.Context, inodeID uint64, path string) (*File, *fusefs.Inode)
- func (dir *Dir) NewSubSymlinkInode(ctx context.Context, inodeID uint64, path string, target string) (*Symlink, *fusefs.Inode)
- func (dir *Dir) Opendir(ctx context.Context) syscall.Errno
- func (dir *Dir) Readdir(ctx context.Context) (fusefs.DirStream, syscall.Errno)
- func (dir *Dir) Rename(ctx context.Context, name string, newParent fusefs.InodeEmbedder, ...) syscall.Errno
- func (dir *Dir) Rmdir(ctx context.Context, name string) syscall.Errno
- func (dir *Dir) Setattr(ctx context.Context, fh fusefs.FileHandle, in *fuse.SetAttrIn, ...) syscall.Errno
- func (dir *Dir) Statfs(ctx context.Context, out *fuse.StatfsOut) syscall.Errno
- func (dir *Dir) Symlink(ctx context.Context, target string, name string, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)
- func (dir *Dir) Unlink(ctx context.Context, name string) syscall.Errno
- type File
- func (file *File) Getattr(ctx context.Context, fh fusefs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (file *File) Getlk(ctx context.Context, fh fusefs.FileHandle, owner uint64, lk *fuse.FileLock, ...) syscall.Errno
- func (file *File) Open(ctx context.Context, flags uint32) (fusefs.FileHandle, uint32, syscall.Errno)
- func (file *File) Setattr(ctx context.Context, fh fusefs.FileHandle, in *fuse.SetAttrIn, ...) syscall.Errno
- func (file *File) Setlk(ctx context.Context, fh fusefs.FileHandle, owner uint64, lk *fuse.FileLock, ...) syscall.Errno
- func (file *File) Setlkw(ctx context.Context, fh fusefs.FileHandle, owner uint64, lk *fuse.FileLock, ...) syscall.Errno
- func (file *File) Truncate(ctx context.Context, size uint64) syscall.Errno
- type FileHandle
- func (handle *FileHandle) Flush(ctx context.Context) syscall.Errno
- func (handle *FileHandle) Fsync(ctx context.Context, flags uint32) syscall.Errno
- func (handle *FileHandle) GetID() string
- func (handle *FileHandle) GetPath() string
- func (handle *FileHandle) Getattr(ctx context.Context, out *fuse.AttrOut) syscall.Errno
- func (handle *FileHandle) Getlk(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32, ...) syscall.Errno
- func (handle *FileHandle) Read(ctx context.Context, dest []byte, offset int64) (fuse.ReadResult, syscall.Errno)
- func (handle *FileHandle) Release(ctx context.Context) syscall.Errno
- func (handle *FileHandle) SetFile(file *File)
- func (handle *FileHandle) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- func (handle *FileHandle) Setlk(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno
- func (handle *FileHandle) Setlkw(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno
- func (handle *FileHandle) Truncate(ctx context.Context, size uint64) syscall.Errno
- func (handle *FileHandle) Write(ctx context.Context, data []byte, offset int64) (uint32, syscall.Errno)
- type FileHandleMap
- func (fileHandleMap *FileHandleMap) Add(handle *FileHandle)
- func (fileHandleMap *FileHandleMap) Clear()
- func (fileHandleMap *FileHandleMap) Get(id string) *FileHandle
- func (fileHandleMap *FileHandleMap) List() []*FileHandle
- func (fileHandleMap *FileHandleMap) ListByPath(path string) []*FileHandle
- func (fileHandleMap *FileHandleMap) ListPathsInDir(parentPath string) []string
- func (fileHandleMap *FileHandleMap) Pop(id string) *FileHandle
- func (fileHandleMap *FileHandleMap) PopAll() []*FileHandle
- func (fileHandleMap *FileHandleMap) PopByPath(path string) []*FileHandle
- func (fileHandleMap *FileHandleMap) Remove(id string)
- func (fileHandleMap *FileHandleMap) Rename(srcPath string, destPath string)
- func (fileHandleMap *FileHandleMap) RenameDir(srcParentPath string, destParentPath string)
- func (fileHandleMap *FileHandleMap) RenameFile(srcPath string, destPath string)
- type IRODSFS
- func (fs *IRODSFS) GetFuseOptions() *fusefs.Options
- func (fs *IRODSFS) GetNextOperationID() uint64
- func (fs *IRODSFS) GetRoot() (*Dir, error)
- func (fs *IRODSFS) IRODSCreate(ctx context.Context, dir *Dir, path string, flags uint32, out *fuse.EntryOut) (int64, *FileHandle, syscall.Errno)
- func (fs *IRODSFS) IRODSExists(ctx context.Context, path string) (bool, syscall.Errno)
- func (fs *IRODSFS) IRODSFsync(ctx context.Context) syscall.Errno
- func (fs *IRODSFS) IRODSGetACL(ctx context.Context, entry *irodsclient_fs.Entry, readonly bool) os.FileMode
- func (fs *IRODSFS) IRODSGetOpenFlags(flags uint32) irodsclient_types.FileOpenMode
- func (fs *IRODSFS) IRODSGetPermission(level irodsclient_types.IRODSAccessLevelType) os.FileMode
- func (fs *IRODSFS) IRODSGetattr(ctx context.Context, path string, vpathReadonly bool, out *fuse.AttrOut) syscall.Errno
- func (fs *IRODSFS) IRODSGetattrSymlink(ctx context.Context, path string, out *fuse.AttrOut) syscall.Errno
- func (fs *IRODSFS) IRODSLookup(ctx context.Context, dir *Dir, path string, vpathReadonly bool, ...) (int64, bool, syscall.Errno)
- func (fs *IRODSFS) IRODSLookupSymlink(ctx context.Context, path string, out *fuse.EntryOut) (int64, syscall.Errno)
- func (fs *IRODSFS) IRODSMkdir(ctx context.Context, dir *Dir, path string, out *fuse.EntryOut) (int64, syscall.Errno)
- func (fs *IRODSFS) IRODSOpen(ctx context.Context, file *File, path string, flags uint32) (*FileHandle, syscall.Errno)
- func (fs *IRODSFS) IRODSOpendir(ctx context.Context, path string) syscall.Errno
- func (fs *IRODSFS) IRODSReaddir(ctx context.Context, path string) ([]fuse.DirEntry, syscall.Errno)
- func (fs *IRODSFS) IRODSReadlink(ctx context.Context, path string) (string, syscall.Errno)
- func (fs *IRODSFS) IRODSRename(ctx context.Context, dir *Dir, srcPath string, destPath string) syscall.Errno
- func (fs *IRODSFS) IRODSRmdir(ctx context.Context, path string) syscall.Errno
- func (fs *IRODSFS) IRODSStat(ctx context.Context, path string) (*irodsclient_fs.Entry, error)
- func (fs *IRODSFS) IRODSSymlink(ctx context.Context, path string, target string, out *fuse.EntryOut) (int64, syscall.Errno)
- func (fs *IRODSFS) IRODSUnlink(ctx context.Context, path string) syscall.Errno
- func (fs *IRODSFS) Mount() error
- func (fs *IRODSFS) Release()
- func (fs *IRODSFS) Unmount()
- func (fs *IRODSFS) Wait()
- type ResolvedDirEntry
- type Symlink
Constants ¶
const ( // SymlinkSuffix marks a data object that holds a symbolic link target. // iRODS has no POSIX symbolic link, so a link shown as "X" is stored as a data // object named "X"+SymlinkSuffix whose content is the link target. Keeping the // marker in the name, rather than in metadata or in the data type column, is // what lets the staging layer carry it to iRODS unchanged. SymlinkSuffix string = ".irodssymlink" // SymlinkTargetMax is the largest link target we store, matching PATH_MAX SymlinkTargetMax int64 = 4096 )
Variables ¶
This section is empty.
Functions ¶
func IsSymlinkStoredName ¶ added in v0.13.1
IsSymlinkStoredName returns true if the given iRODS name stores a symbolic link
func SymlinkStoredName ¶ added in v0.13.1
SymlinkStoredName returns the iRODS name that stores the symbolic link shown under the given name. It applies equally to a full path, whose last component is the name.
func SymlinkVisibleName ¶ added in v0.13.1
SymlinkVisibleName returns the name a symbolic link stored under the given iRODS name is shown under. It returns false if the name does not store a symbolic link.
Types ¶
type Dir ¶
Dir is a directory node
func (*Dir) Create ¶
func (dir *Dir) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (*fusefs.Inode, fusefs.FileHandle, uint32, syscall.Errno)
Create creates a file for the path and returns file handle
func (*Dir) Lookup ¶
func (dir *Dir) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)
Lookup returns a node for the path
func (*Dir) Mkdir ¶
func (dir *Dir) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)
Mkdir makes a dir for the path
func (*Dir) NewSubDirInode ¶ added in v0.13.0
func (*Dir) NewSubFileInode ¶ added in v0.13.0
func (*Dir) NewSubSymlinkInode ¶ added in v0.13.1
func (*Dir) Rename ¶
func (dir *Dir) Rename(ctx context.Context, name string, newParent fusefs.InodeEmbedder, newName string, flags uint32) syscall.Errno
Rename renames a node for the path
func (*Dir) Setattr ¶ added in v0.7.1
func (dir *Dir) Setattr(ctx context.Context, fh fusefs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
Setattr sets dir attributes
func (*Dir) Statfs ¶ added in v0.13.0
Statfs returns filesystem statistics. iRODS does not expose total/free disk usage, so large placeholder values are returned to prevent clients from treating the filesystem as full.
type File ¶
File is a file node
func (*File) Getattr ¶ added in v0.7.9
func (file *File) Getattr(ctx context.Context, fh fusefs.FileHandle, out *fuse.AttrOut) syscall.Errno
Getattr returns stat of file entry
func (*File) Getlk ¶ added in v0.8.16
func (file *File) Getlk(ctx context.Context, fh fusefs.FileHandle, owner uint64, lk *fuse.FileLock, flags uint32, out *fuse.FileLock) syscall.Errno
Getlk returns locks
func (*File) Open ¶
func (file *File) Open(ctx context.Context, flags uint32) (fusefs.FileHandle, uint32, syscall.Errno)
Open opens file for the path and returns file handle
func (*File) Setattr ¶
func (file *File) Setattr(ctx context.Context, fh fusefs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
Setattr sets file attributes
func (*File) Setlk ¶ added in v0.8.16
func (file *File) Setlk(ctx context.Context, fh fusefs.FileHandle, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno
Setlk obtains a lock on a file, or fail if the lock could not obtained
type FileHandle ¶
type FileHandle struct {
// contains filtered or unexported fields
}
FileHandle is a file handle
func NewFileHandle ¶
func NewFileHandle(fs *IRODSFS, fileHandle irodsfscommon_irods.IRODSFSFileHandle) (*FileHandle, error)
func (*FileHandle) Flush ¶
func (handle *FileHandle) Flush(ctx context.Context) syscall.Errno
Flush flushes content changes
func (*FileHandle) GetID ¶ added in v0.9.4
func (handle *FileHandle) GetID() string
GetID returns ID
func (*FileHandle) GetPath ¶ added in v0.9.4
func (handle *FileHandle) GetPath() string
GetPath returns path
func (*FileHandle) Getlk ¶ added in v0.8.16
func (handle *FileHandle) Getlk(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32, out *fuse.FileLock) syscall.Errno
Getlk returns a lock that conflicts with the given lock
func (*FileHandle) Read ¶
func (handle *FileHandle) Read(ctx context.Context, dest []byte, offset int64) (fuse.ReadResult, syscall.Errno)
Read reads file content
func (*FileHandle) Release ¶
func (handle *FileHandle) Release(ctx context.Context) syscall.Errno
Release closes file handle
func (*FileHandle) SetFile ¶ added in v0.9.0
func (handle *FileHandle) SetFile(file *File)
SetFile sets File
func (*FileHandle) Setattr ¶ added in v0.7.9
func (handle *FileHandle) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
Setattr sets file attributes
func (*FileHandle) Setlk ¶ added in v0.8.16
func (handle *FileHandle) Setlk(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno
Setlk locks the file handle, or fails if the lock is held by someone else
func (*FileHandle) Setlkw ¶ added in v0.8.16
func (handle *FileHandle) Setlkw(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno
Setlkw locks the file handle and waits until it acquires the lock
type FileHandleMap ¶
type FileHandleMap struct {
// contains filtered or unexported fields
}
func NewFileHandleMap ¶
func NewFileHandleMap() *FileHandleMap
NewFileHandleMap creates a new FileHandleMap
func (*FileHandleMap) Add ¶
func (fileHandleMap *FileHandleMap) Add(handle *FileHandle)
Add registers a file handle
func (*FileHandleMap) Clear ¶
func (fileHandleMap *FileHandleMap) Clear()
Clear clears all file handles registered
func (*FileHandleMap) Get ¶
func (fileHandleMap *FileHandleMap) Get(id string) *FileHandle
Get returns a file handle registered using ID
func (*FileHandleMap) List ¶
func (fileHandleMap *FileHandleMap) List() []*FileHandle
List lists all file handles registered
func (*FileHandleMap) ListByPath ¶
func (fileHandleMap *FileHandleMap) ListByPath(path string) []*FileHandle
ListByPath returns file handles registered using path
func (*FileHandleMap) ListPathsInDir ¶
func (fileHandleMap *FileHandleMap) ListPathsInDir(parentPath string) []string
ListPathsUnderDir returns paths of file handles under given parent path
func (*FileHandleMap) Pop ¶
func (fileHandleMap *FileHandleMap) Pop(id string) *FileHandle
Pop pops a file handle registered using ID and returns the handle
func (*FileHandleMap) PopAll ¶
func (fileHandleMap *FileHandleMap) PopAll() []*FileHandle
PopAll pops all file handles registered (clear) and returns
func (*FileHandleMap) PopByPath ¶
func (fileHandleMap *FileHandleMap) PopByPath(path string) []*FileHandle
PopByPath pops file handles registered using path and returns the handles
func (*FileHandleMap) Remove ¶
func (fileHandleMap *FileHandleMap) Remove(id string)
Remove deletes a file handle registered using ID
func (*FileHandleMap) Rename ¶
func (fileHandleMap *FileHandleMap) Rename(srcPath string, destPath string)
Rename renames files or dirs
func (*FileHandleMap) RenameDir ¶
func (fileHandleMap *FileHandleMap) RenameDir(srcParentPath string, destParentPath string)
RenameDir renames files under parentPath
func (*FileHandleMap) RenameFile ¶ added in v0.9.0
func (fileHandleMap *FileHandleMap) RenameFile(srcPath string, destPath string)
RenameFile renames files
type IRODSFS ¶
type IRODSFS struct {
// contains filtered or unexported fields
}
IRODSFS is a file system object
func NewFileSystem ¶
NewFileSystem creates a new file system
func (*IRODSFS) GetFuseOptions ¶ added in v0.13.0
GetFuseOptions returns fuse options
func (*IRODSFS) GetNextOperationID ¶
GetNextOperationID returns next operation ID
func (*IRODSFS) IRODSCreate ¶ added in v0.13.0
func (fs *IRODSFS) IRODSCreate(ctx context.Context, dir *Dir, path string, flags uint32, out *fuse.EntryOut) (int64, *FileHandle, syscall.Errno)
IRODSCreate creates file for the given irods path
func (*IRODSFS) IRODSExists ¶ added in v0.13.1
IRODSExists returns true if an entry exists at the given irods path
func (*IRODSFS) IRODSFsync ¶ added in v0.13.0
IRODSFsync syncs filesytem
func (*IRODSFS) IRODSGetACL ¶ added in v0.13.0
func (fs *IRODSFS) IRODSGetACL(ctx context.Context, entry *irodsclient_fs.Entry, readonly bool) os.FileMode
IRODSGetACL returns ACL flag from iRODS entry
func (*IRODSFS) IRODSGetOpenFlags ¶ added in v0.13.0
func (fs *IRODSFS) IRODSGetOpenFlags(flags uint32) irodsclient_types.FileOpenMode
IRODSGetOpenFlags converts file open flags to iRODS file open mode
func (*IRODSFS) IRODSGetPermission ¶ added in v0.13.0
func (fs *IRODSFS) IRODSGetPermission(level irodsclient_types.IRODSAccessLevelType) os.FileMode
IRODSGetACL returns permission flag from iRODS access level type
func (*IRODSFS) IRODSGetattr ¶ added in v0.13.0
func (fs *IRODSFS) IRODSGetattr(ctx context.Context, path string, vpathReadonly bool, out *fuse.AttrOut) syscall.Errno
IRODSGetattr returns an attr for the given irods path
func (*IRODSFS) IRODSGetattrSymlink ¶ added in v0.13.1
func (fs *IRODSFS) IRODSGetattrSymlink(ctx context.Context, path string, out *fuse.AttrOut) syscall.Errno
IRODSGetattrSymlink returns an attr for the symbolic link stored at the given irods path
func (*IRODSFS) IRODSLookup ¶ added in v0.13.0
func (fs *IRODSFS) IRODSLookup(ctx context.Context, dir *Dir, path string, vpathReadonly bool, out *fuse.EntryOut) (int64, bool, syscall.Errno)
IRODSLookup returns entry for the given irods path
func (*IRODSFS) IRODSLookupSymlink ¶ added in v0.13.1
func (fs *IRODSFS) IRODSLookupSymlink(ctx context.Context, path string, out *fuse.EntryOut) (int64, syscall.Errno)
IRODSLookupSymlink returns entry for the symbolic link stored at the given irods path
func (*IRODSFS) IRODSMkdir ¶ added in v0.13.0
func (fs *IRODSFS) IRODSMkdir(ctx context.Context, dir *Dir, path string, out *fuse.EntryOut) (int64, syscall.Errno)
IRODSMkdir removes dir for the given irods path
func (*IRODSFS) IRODSOpen ¶ added in v0.13.0
func (fs *IRODSFS) IRODSOpen(ctx context.Context, file *File, path string, flags uint32) (*FileHandle, syscall.Errno)
IRODSOpen opens file for the given irods path
func (*IRODSFS) IRODSOpendir ¶ added in v0.13.0
IRODSOpendir opens dir for the given irods path
func (*IRODSFS) IRODSReaddir ¶ added in v0.13.0
IRODSReaddir reads dir entries for the given irods path
func (*IRODSFS) IRODSReadlink ¶ added in v0.13.1
IRODSReadlink returns the target of the symbolic link stored at the given irods path
func (*IRODSFS) IRODSRename ¶ added in v0.13.0
func (fs *IRODSFS) IRODSRename(ctx context.Context, dir *Dir, srcPath string, destPath string) syscall.Errno
IRODSRename renames file or dir for the given irods path
func (*IRODSFS) IRODSRmdir ¶ added in v0.13.0
IRODSRmdir removes dir for the given irods path
func (*IRODSFS) IRODSSymlink ¶ added in v0.13.1
func (fs *IRODSFS) IRODSSymlink(ctx context.Context, path string, target string, out *fuse.EntryOut) (int64, syscall.Errno)
IRODSSymlink creates a symbolic link holding the given target at the given irods path
func (*IRODSFS) IRODSUnlink ¶ added in v0.13.0
IRODSUnlink removes file for the given irods path
type ResolvedDirEntry ¶ added in v0.13.1
type ResolvedDirEntry struct {
Entry *irodsclient_fs.Entry
VisibleName string
IsSymlink bool
}
ResolvedDirEntry is an iRODS entry paired with the name it is shown under
func ResolveDirEntries ¶ added in v0.13.1
func ResolveDirEntries(entries []*irodsclient_fs.Entry) ([]*ResolvedDirEntry, []string)
ResolveDirEntries maps iRODS entries to the names they are shown under.
A real entry always wins over a symbolic link claiming the same visible name: given both "X" and "X"+SymlinkSuffix, "X" is shown and the link is returned as shadowed so that the caller can warn about it. Lookup probes the plain name first, so this keeps Readdir and Lookup in agreement by construction.
A symbolic link is always a data object, so a collection keeps its own name even when that name ends with the suffix.
type Symlink ¶ added in v0.13.1
Symlink is a symbolic link node
func NewSymlink ¶ added in v0.13.1
NewSymlink creates a new Symlink. The target may be empty, in which case it is read from iRODS on the first Readlink.