Documentation ¶
Overview ¶
*
** Loader will load all the files and directories at a root. It assumes that the root already exists so it skips ** sending the starting directory to the Skipper and Loader functions. ** MCFileLoader loads files and directories into a Materials Commons project. It does various checks to see ** if the file or directory already exists.
Index ¶
- func DefaultSkipper(path string, finfo os.FileInfo) bool
- func Exists(path string) bool
- func IsDir(path string) bool
- func MCFileDir(path, fileID string) string
- func MoveFile(src, dst string, removeSrc bool) error
- type BackgroundLoader
- type DirectoryLoader
- type ExcludeListSkipper
- type FileAndDirFilter
- type Loader
- type MCFileLoader
- type MediaType
- type ProjectDownload
- type Skipper
- type Zipper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultSkipper ¶
DefaultSkipper doesn't skip any entries.
Types ¶
type BackgroundLoader ¶
type BackgroundLoader struct {
// contains filtered or unexported fields
}
func NewBackgroundLoader ¶
func NewBackgroundLoader(mcdir string, numberOfWorkers int, db store.DB) *BackgroundLoader
func (*BackgroundLoader) Start ¶
func (l *BackgroundLoader) Start(c context.Context)
type DirectoryLoader ¶
type ExcludeListSkipper ¶
ExcludeListSkipper contains a list of entries to skip
func NewExcludeListSkipper ¶
func NewExcludeListSkipper(excludeList []string) *ExcludeListSkipper
NewExcludeListSkipper creates a new ExludeListSkipper from the list of entries to exclude.
type FileAndDirFilter ¶
type Loader ¶
type Loader struct { Skipper Skipper // Method to call to see if this entry should be skipped DirectoryLoader DirectoryLoader // Interface to call to load the entry if it is not skipped }
func NewFileLoader ¶
func NewFileLoader(skipper Skipper, loader DirectoryLoader) *Loader
type MCFileLoader ¶
type MCFileLoader struct {
// contains filtered or unexported fields
}
func NewMCFileLoader ¶
func NewMCFileLoader(root, owner, mcdir string, project model.ProjectSimpleModel, dfStore *store.DatafilesStore, ddStore *store.DatadirsStore) *MCFileLoader
func (*MCFileLoader) LoadFileOrDir ¶
func (l *MCFileLoader) LoadFileOrDir(path string, finfo os.FileInfo) error
type MediaType ¶
func GetMediaTypeByExtension ¶
type ProjectDownload ¶
type ProjectDownload struct { ProjectID string User model.UserSchema // contains filtered or unexported fields }
func NewProjectDownload ¶
func NewProjectDownload(projectID string, user model.UserSchema, ddirsStore *store.DatadirsStore) *ProjectDownload
func (*ProjectDownload) CreateProjectDownloadDirectory ¶
func (d *ProjectDownload) CreateProjectDownloadDirectory(basePath string) error
CreateProjectDownloadDirectory creates a download directory for the given project. It will walk through the projects directories and create them in this temporary download. It will then create a link to in this directory that points at the file entry in the Materials Commons store. The reason this needs to be done is that the Materials Commons store is an object store (like S3), where as Globus (and users) need to see the imposed directory structure. This is reconstructed from the database. Links to files are used so we don't have to create copies of the files.
type Zipper ¶
type Zipper struct {
// contains filtered or unexported fields
}