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 ¶
func NewDirMaker(path PathInfo, config config.Configuration) DirMaker
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.
type FileSystemScanner ¶
type FileSystemScanner struct {
// contains filtered or unexported fields
}
FileSystemScanner implements the `Scanner` interface for a POSIX-compliant filesystem.
func (FileSystemScanner) CountFilesInDir ¶
func (s FileSystemScanner) CountFilesInDir(ctx context.Context, dir string) int
func (FileSystemScanner) ScanMakeDir ¶
func (s FileSystemScanner) ScanMakeDir(ctx context.Context, 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.
type IrodsCollectionScanner ¶
type IrodsCollectionScanner struct {
// contains filtered or unexported fields
}
IrodsCollectionScanner implements the `Scanner` interface for iRODS.
func (IrodsCollectionScanner) CountFilesInDir ¶
func (s IrodsCollectionScanner) CountFilesInDir(ctx context.Context, dir string) int
func (IrodsCollectionScanner) ScanMakeDir ¶
func (s IrodsCollectionScanner) ScanMakeDir(ctx context.Context, 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
// Size
Size int64
// contains filtered or unexported fields
}
PathInfo defines a data structure of the path information.
func GetPathInfo ¶
GetPathInfo resolves the PathInfo of the given path.
func (PathInfo) GetChecksum ¶
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(ctx context.Context, buffer int, dirmaker *DirMaker) chan string
// CountFilesInDir counts number of files in a given directory
CountFilesInDir(ctx context.Context, dir string) int
}
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.