Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirMaker ¶
DirMaker defines interface for implementing directory creation in local filesystem and iRODS.
func NewDirMaker ¶
NewDirMaker determines the path type and returns a corresponding implementation of the DirMaker interface.
type FileSystemDirMaker ¶
type FileSystemDirMaker struct {
// contains filtered or unexported fields
}
FileSystemDirMaker implements the DirMaker for local filesystem.
func (FileSystemDirMaker) Mkdir ¶
func (m FileSystemDirMaker) Mkdir(path string) error
Mkdir ensures the directory referred by the path is created.
type FileSystemScanner ¶
type FileSystemScanner struct {
// contains filtered or unexported fields
}
FileSystemScanner implements the `Scanner` interface for a POSIX-compliant filesystem.
func (FileSystemScanner) ScanMakeDir ¶
func (s FileSystemScanner) ScanMakeDir(path string, buffer int, dirmaker *DirMaker) chan string
ScanMakeDir gets a list of files iteratively under a file system `path`, and performs directory creation based on the implementation of the `dirmaker`.
The output is a string channel with the buffer size provided by the `buffer` argument. Each element of the channel refers to a file path. The channel is closed at the end of the scan.
type IrodsCollectionMaker ¶
type IrodsCollectionMaker struct {
// contains filtered or unexported fields
}
IrodsCollectionMaker implements the DirMaker for iRODS, using the `imkdir` system call.
func (IrodsCollectionMaker) Mkdir ¶
func (m IrodsCollectionMaker) Mkdir(coll string) error
Mkdir ensures the iRODS collection referred by the path is created.
type IrodsCollectionScanner ¶
type IrodsCollectionScanner struct {
// contains filtered or unexported fields
}
IrodsCollectionScanner implements the `Scanner` interface for iRODS.
func (IrodsCollectionScanner) ScanMakeDir ¶
func (s IrodsCollectionScanner) ScanMakeDir(path string, buffer int, dirmaker *DirMaker) chan string
ScanMakeDir gets a list of data objects iteratively under a iRODS collection `path`, and performs directory creation based on the implementation of `dirmaker`.
The output is a string channel with the buffer size provided by the `buffer` argument. Each element of the channel refers to an iRODS data object. The channel is closed at the end of the scan.
type PathInfo ¶
type PathInfo struct {
// Path is the path in question.
Path string
// PathType is the namespace type of the path.
Type PathType
// Mode is the `os.FileMode` of the path.
Mode os.FileMode
}
PathInfo defines a data structure of the path information.
type Scanner ¶
type Scanner interface {
// ScanMakeDir gets a list of file-like objects iteratively under the given path, and
// performs mkdir-like operations when the iteration visits a directory-like object.
//
// How the iteration is done depends on the implementation. How the mkdir-like operation is
// performed is also based on the implementation of the `dirmaker`. Set the `dirmaker` to
// `nil` to skip the directory making operation.
//
// For example, it can be that the Scanner is implemented to loop over a local filesystem using
// the `filepath.Walk`, while the `dirmaker` is implemented to create a remote iRODS collection.
ScanMakeDir(path string, buffer int, dirmaker *DirMaker) chan string
}
Scanner defines the interface for scanning files iteratively from a namespace `path`.
func NewScanner ¶
NewScanner determines the path type and returns a corresponding implementation of the Scanner interface.