Documentation ¶
Index ¶
- Variables
- func IsRecordNotFound(err error) bool
- func WithTxRetry(db *gorm.DB, fn func(tx *gorm.DB) error) error
- type ConversionStor
- type FileStor
- type GlobusTransferStor
- type GormConversionStor
- type GormFileStor
- func (s *GormFileStor) CreateDirIfNotExists(parentDirID int, path, name string, projectID, ownerID int) (*mcmodel.File, error)
- func (s *GormFileStor) CreateDirectory(parentDirID, projectID, ownerID int, path, name string) (*mcmodel.File, error)
- func (s *GormFileStor) CreateFile(name string, projectID, directoryID, ownerID int, mimeType string) (*mcmodel.File, error)
- func (s *GormFileStor) DoneWritingToFile(file *mcmodel.File, checksum string, size int64, ...) (bool, error)
- func (s *GormFileStor) GetDirByPath(projectID int, path string) (*mcmodel.File, error)
- func (s *GormFileStor) GetFileByID(fileID int) (*mcmodel.File, error)
- func (s *GormFileStor) GetFileByPath(projectID int, path string) (*mcmodel.File, error)
- func (s *GormFileStor) GetFileByUUID(fileUUID string) (*mcmodel.File, error)
- func (s *GormFileStor) GetOrCreateDirPath(projectID, ownerID int, path string) (*mcmodel.File, error)
- func (s *GormFileStor) ListDirectoryByPath(projectID int, path string) ([]mcmodel.File, error)
- func (s *GormFileStor) PointAtExistingIfExists(file *mcmodel.File) (bool, error)
- func (s *GormFileStor) SetFileAsCurrent(file *mcmodel.File) (*mcmodel.File, error)
- func (s *GormFileStor) SetUsesToNull(file *mcmodel.File) (*mcmodel.File, error)
- func (s *GormFileStor) UpdateFile(file, updates *mcmodel.File) (*mcmodel.File, error)
- func (s *GormFileStor) UpdateFileUses(file *mcmodel.File, uuid string, fileID int) error
- func (s *GormFileStor) UpdateMetadataForFileAndProject(file *mcmodel.File, checksum string, totalBytes int64) error
- type GormGlobusTransferStor
- type GormProjectStor
- func (s *GormProjectStor) AddAdminToProject(project *mcmodel.Project, user *mcmodel.User) error
- func (s *GormProjectStor) AddMemberToProject(project *mcmodel.Project, user *mcmodel.User) error
- func (s *GormProjectStor) CreateProject(project *mcmodel.Project) (*mcmodel.Project, error)
- func (s *GormProjectStor) GetProjectByID(projectID int) (*mcmodel.Project, error)
- func (s *GormProjectStor) GetProjectBySlug(slug string) (*mcmodel.Project, error)
- func (s *GormProjectStor) GetProjectsForUser(userID int) ([]mcmodel.Project, error)
- func (s *GormProjectStor) UpdateProjectDirectoryCount(projectID int, directoryCount int) error
- func (s *GormProjectStor) UpdateProjectSizeAndFileCount(projectID int, size int64, fileCount int) error
- func (s *GormProjectStor) UserCanAccessProject(userID, projectID int) bool
- type GormTransferRequestFileStor
- func (s *GormTransferRequestFileStor) DeleteTransferFileRequestByPath(ownerID, projectID int, path string) error
- func (s *GormTransferRequestFileStor) DeleteTransferRequestFile(transferRequestFile *mcmodel.TransferRequestFile) error
- func (s *GormTransferRequestFileStor) GetTransferFileRequestByPath(ownerID, projectID int, path string) (*mcmodel.TransferRequestFile, error)
- func (s *GormTransferRequestFileStor) GetTransferRequestFileByPathForTransferRequest(path string, transferRequest *mcmodel.TransferRequest) (*mcmodel.TransferRequestFile, error)
- type GormTransferRequestStor
- func (s *GormTransferRequestStor) CloseTransferRequestByUUID(transferUUID string) error
- func (s *GormTransferRequestStor) CreateNewFile(file, dir *mcmodel.File, transferRequest *mcmodel.TransferRequest) (*mcmodel.File, error)
- func (s *GormTransferRequestStor) CreateNewFileVersion(file, dir *mcmodel.File, transferRequest *mcmodel.TransferRequest) (*mcmodel.File, error)
- func (s *GormTransferRequestStor) CreateTransferRequest(tr *mcmodel.TransferRequest) (*mcmodel.TransferRequest, error)
- func (s *GormTransferRequestStor) GetFileByPath(path string, transferRequest *mcmodel.TransferRequest) (*mcmodel.File, error)
- func (s *GormTransferRequestStor) GetTransferRequestByUUID(transferUUID string) (*mcmodel.TransferRequest, error)
- func (s *GormTransferRequestStor) GetTransferRequestForProjectAndUser(projectID, userID int) (*mcmodel.TransferRequest, error)
- func (s *GormTransferRequestStor) GetTransferRequestsForProject(projectID int) ([]mcmodel.TransferRequest, error)
- func (s *GormTransferRequestStor) ListDirectory(dir *mcmodel.File, transferRequest *mcmodel.TransferRequest) ([]mcmodel.File, error)
- func (s *GormTransferRequestStor) ListTransferRequests() ([]mcmodel.TransferRequest, error)
- func (s *GormTransferRequestStor) MarkFileAsOpen(file *mcmodel.File) error
- func (s *GormTransferRequestStor) MarkFileReleased(file *mcmodel.File, checksum string, projectID int, totalBytes int64) error
- type GormUserStor
- func (s *GormUserStor) CreateUser(user *mcmodel.User) (*mcmodel.User, error)
- func (s *GormUserStor) GetUserByAPIToken(email string) (*mcmodel.User, error)
- func (s *GormUserStor) GetUserByEmail(email string) (*mcmodel.User, error)
- func (s *GormUserStor) GetUserBySlug(slug string) (*mcmodel.User, error)
- func (s *GormUserStor) GetUsersWithGlobusAccount() ([]mcmodel.User, error)
- type ProjectStor
- type Stors
- type TransferRequestFileStor
- type TransferRequestStor
- type UserStor
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = fmt.Errorf("not implemented")
Functions ¶
func IsRecordNotFound ¶
Types ¶
type ConversionStor ¶
type ConversionStor interface {
AddFileToConvert(file *mcmodel.File) (*mcmodel.Conversion, error)
}
type FileStor ¶
type FileStor interface { GetFileByID(fileID int) (*mcmodel.File, error) GetFileByUUID(fileUUID string) (*mcmodel.File, error) UpdateMetadataForFileAndProject(file *mcmodel.File, checksum string, totalBytes int64) error UpdateFile(file, updates *mcmodel.File) (*mcmodel.File, error) SetUsesToNull(file *mcmodel.File) (*mcmodel.File, error) SetFileAsCurrent(file *mcmodel.File) (*mcmodel.File, error) CreateFile(name string, projectID, directoryID, ownerID int, mimeType string) (*mcmodel.File, error) GetDirByPath(projectID int, path string) (*mcmodel.File, error) CreateDirectory(parentDirID, projectID, ownerID int, path, name string) (*mcmodel.File, error) CreateDirIfNotExists(parentDirID int, path, name string, projectID, ownerID int) (*mcmodel.File, error) ListDirectoryByPath(projectID int, path string) ([]mcmodel.File, error) GetOrCreateDirPath(projectID, ownerID int, path string) (*mcmodel.File, error) GetFileByPath(projectID int, path string) (*mcmodel.File, error) UpdateFileUses(file *mcmodel.File, uuid string, fileID int) error PointAtExistingIfExists(file *mcmodel.File) (bool, error) DoneWritingToFile(file *mcmodel.File, checksum string, size int64, conversionStore ConversionStor) (bool, error) }
type GlobusTransferStor ¶
type GlobusTransferStor interface { CreateGlobusTransfer(globusTransfer *mcmodel.GlobusTransfer) (*mcmodel.GlobusTransfer, error) GetGlobusTransferByGlobusIdentityID(globusIdentityID string) (*mcmodel.GlobusTransfer, error) }
type GormConversionStor ¶
type GormConversionStor struct {
// contains filtered or unexported fields
}
func NewGormConversionStor ¶
func NewGormConversionStor(db *gorm.DB) *GormConversionStor
func (*GormConversionStor) AddFileToConvert ¶
func (s *GormConversionStor) AddFileToConvert(file *mcmodel.File) (*mcmodel.Conversion, error)
type GormFileStor ¶
type GormFileStor struct {
// contains filtered or unexported fields
}
func NewGormFileStor ¶
func NewGormFileStor(db *gorm.DB, mcfsRoot string) *GormFileStor
func (*GormFileStor) CreateDirIfNotExists ¶
func (*GormFileStor) CreateDirectory ¶
func (*GormFileStor) CreateFile ¶
func (*GormFileStor) DoneWritingToFile ¶
func (s *GormFileStor) DoneWritingToFile(file *mcmodel.File, checksum string, size int64, conversionStore ConversionStor) (bool, error)
DoneWritingToFile is called when a file has been opened for writing and the caller is finished writing to it. It consolidates common steps such as updating metadata, switching to point to a file that already exists with the same checksum, and queuing the file for conversion (if needed).
func (*GormFileStor) GetDirByPath ¶
func (*GormFileStor) GetFileByID ¶
func (s *GormFileStor) GetFileByID(fileID int) (*mcmodel.File, error)
func (*GormFileStor) GetFileByPath ¶
func (*GormFileStor) GetFileByUUID ¶
func (s *GormFileStor) GetFileByUUID(fileUUID string) (*mcmodel.File, error)
func (*GormFileStor) GetOrCreateDirPath ¶
func (s *GormFileStor) GetOrCreateDirPath(projectID, ownerID int, path string) (*mcmodel.File, error)
GetOrCreateDirPath will create all entries in the directory path if the path doesn't exist
func (*GormFileStor) ListDirectoryByPath ¶
func (*GormFileStor) PointAtExistingIfExists ¶
func (s *GormFileStor) PointAtExistingIfExists(file *mcmodel.File) (bool, error)
func (*GormFileStor) SetFileAsCurrent ¶
func (*GormFileStor) SetUsesToNull ¶
func (*GormFileStor) UpdateFile ¶
func (*GormFileStor) UpdateFileUses ¶
func (*GormFileStor) UpdateMetadataForFileAndProject ¶
func (s *GormFileStor) UpdateMetadataForFileAndProject(file *mcmodel.File, checksum string, totalBytes int64) error
UpdateMetadataForFileAndProject updates the metadata and project meta data for a file
type GormGlobusTransferStor ¶
type GormGlobusTransferStor struct {
// contains filtered or unexported fields
}
func NewGormGlobusTransferStor ¶
func NewGormGlobusTransferStor(db *gorm.DB) *GormGlobusTransferStor
func (*GormGlobusTransferStor) CreateGlobusTransfer ¶
func (s *GormGlobusTransferStor) CreateGlobusTransfer(globusTransfer *mcmodel.GlobusTransfer) (*mcmodel.GlobusTransfer, error)
CreateGlobusTransfer creates a new GlobusTransfer, filling in the ID and UUID for the globus transfer passed in.
func (*GormGlobusTransferStor) GetGlobusTransferByGlobusIdentityID ¶
func (s *GormGlobusTransferStor) GetGlobusTransferByGlobusIdentityID(globusIdentityID string) (*mcmodel.GlobusTransfer, error)
type GormProjectStor ¶
type GormProjectStor struct {
// contains filtered or unexported fields
}
func NewGormProjectStor ¶
func NewGormProjectStor(db *gorm.DB) *GormProjectStor
func (*GormProjectStor) AddAdminToProject ¶
func (*GormProjectStor) AddMemberToProject ¶
func (*GormProjectStor) CreateProject ¶
func (*GormProjectStor) GetProjectByID ¶
func (s *GormProjectStor) GetProjectByID(projectID int) (*mcmodel.Project, error)
func (*GormProjectStor) GetProjectBySlug ¶
func (s *GormProjectStor) GetProjectBySlug(slug string) (*mcmodel.Project, error)
func (*GormProjectStor) GetProjectsForUser ¶
func (s *GormProjectStor) GetProjectsForUser(userID int) ([]mcmodel.Project, error)
func (*GormProjectStor) UpdateProjectDirectoryCount ¶
func (s *GormProjectStor) UpdateProjectDirectoryCount(projectID int, directoryCount int) error
func (*GormProjectStor) UpdateProjectSizeAndFileCount ¶
func (s *GormProjectStor) UpdateProjectSizeAndFileCount(projectID int, size int64, fileCount int) error
func (*GormProjectStor) UserCanAccessProject ¶
func (s *GormProjectStor) UserCanAccessProject(userID, projectID int) bool
type GormTransferRequestFileStor ¶
type GormTransferRequestFileStor struct {
// contains filtered or unexported fields
}
func NewGormTransferRequestFileStor ¶
func NewGormTransferRequestFileStor(db *gorm.DB) *GormTransferRequestFileStor
func (*GormTransferRequestFileStor) DeleteTransferFileRequestByPath ¶
func (s *GormTransferRequestFileStor) DeleteTransferFileRequestByPath(ownerID, projectID int, path string) error
func (*GormTransferRequestFileStor) DeleteTransferRequestFile ¶
func (s *GormTransferRequestFileStor) DeleteTransferRequestFile(transferRequestFile *mcmodel.TransferRequestFile) error
func (*GormTransferRequestFileStor) GetTransferFileRequestByPath ¶
func (s *GormTransferRequestFileStor) GetTransferFileRequestByPath(ownerID, projectID int, path string) (*mcmodel.TransferRequestFile, error)
func (*GormTransferRequestFileStor) GetTransferRequestFileByPathForTransferRequest ¶
func (s *GormTransferRequestFileStor) GetTransferRequestFileByPathForTransferRequest(path string, transferRequest *mcmodel.TransferRequest) (*mcmodel.TransferRequestFile, error)
type GormTransferRequestStor ¶
type GormTransferRequestStor struct {
// contains filtered or unexported fields
}
func NewGormTransferRequestStor ¶
func NewGormTransferRequestStor(db *gorm.DB, mcfsRoot string) *GormTransferRequestStor
func (*GormTransferRequestStor) CloseTransferRequestByUUID ¶
func (s *GormTransferRequestStor) CloseTransferRequestByUUID(transferUUID string) error
func (*GormTransferRequestStor) CreateNewFile ¶
func (s *GormTransferRequestStor) CreateNewFile(file, dir *mcmodel.File, transferRequest *mcmodel.TransferRequest) (*mcmodel.File, error)
func (*GormTransferRequestStor) CreateNewFileVersion ¶
func (s *GormTransferRequestStor) CreateNewFileVersion(file, dir *mcmodel.File, transferRequest *mcmodel.TransferRequest) (*mcmodel.File, error)
func (*GormTransferRequestStor) CreateTransferRequest ¶
func (s *GormTransferRequestStor) CreateTransferRequest(tr *mcmodel.TransferRequest) (*mcmodel.TransferRequest, error)
CreateTransferRequest creates a new TransferRequest, filling in the ID and UUID for the transfer request passed in.
func (*GormTransferRequestStor) GetFileByPath ¶
func (s *GormTransferRequestStor) GetFileByPath(path string, transferRequest *mcmodel.TransferRequest) (*mcmodel.File, error)
func (*GormTransferRequestStor) GetTransferRequestByUUID ¶
func (s *GormTransferRequestStor) GetTransferRequestByUUID(transferUUID string) (*mcmodel.TransferRequest, error)
func (*GormTransferRequestStor) GetTransferRequestForProjectAndUser ¶
func (s *GormTransferRequestStor) GetTransferRequestForProjectAndUser(projectID, userID int) (*mcmodel.TransferRequest, error)
func (*GormTransferRequestStor) GetTransferRequestsForProject ¶
func (s *GormTransferRequestStor) GetTransferRequestsForProject(projectID int) ([]mcmodel.TransferRequest, error)
func (*GormTransferRequestStor) ListDirectory ¶
func (s *GormTransferRequestStor) ListDirectory(dir *mcmodel.File, transferRequest *mcmodel.TransferRequest) ([]mcmodel.File, error)
func (*GormTransferRequestStor) ListTransferRequests ¶
func (s *GormTransferRequestStor) ListTransferRequests() ([]mcmodel.TransferRequest, error)
ListTransferRequests returns the list of all active transfer requests. An active transfer request has its state set to "open".
func (*GormTransferRequestStor) MarkFileAsOpen ¶
func (s *GormTransferRequestStor) MarkFileAsOpen(file *mcmodel.File) error
func (*GormTransferRequestStor) MarkFileReleased ¶
func (s *GormTransferRequestStor) MarkFileReleased(file *mcmodel.File, checksum string, projectID int, totalBytes int64) error
MarkFileReleased should only be called for files that were created or opened with the Write flag set.
type GormUserStor ¶
type GormUserStor struct {
// contains filtered or unexported fields
}
func NewGormUserStor ¶
func NewGormUserStor(db *gorm.DB) *GormUserStor
func (*GormUserStor) CreateUser ¶
CreateUser creates a new user.
func (*GormUserStor) GetUserByAPIToken ¶
func (s *GormUserStor) GetUserByAPIToken(email string) (*mcmodel.User, error)
func (*GormUserStor) GetUserByEmail ¶
func (s *GormUserStor) GetUserByEmail(email string) (*mcmodel.User, error)
func (*GormUserStor) GetUserBySlug ¶
func (s *GormUserStor) GetUserBySlug(slug string) (*mcmodel.User, error)
func (*GormUserStor) GetUsersWithGlobusAccount ¶
func (s *GormUserStor) GetUsersWithGlobusAccount() ([]mcmodel.User, error)
type ProjectStor ¶
type ProjectStor interface { CreateProject(project *mcmodel.Project) (*mcmodel.Project, error) GetProjectByID(projectID int) (*mcmodel.Project, error) GetProjectBySlug(slug string) (*mcmodel.Project, error) GetProjectsForUser(userID int) ([]mcmodel.Project, error) UpdateProjectSizeAndFileCount(projectID int, size int64, fileCount int) error UpdateProjectDirectoryCount(projectID int, directoryCount int) error UserCanAccessProject(userID, projectID int) bool AddMemberToProject(project *mcmodel.Project, user *mcmodel.User) error AddAdminToProject(project *mcmodel.Project, user *mcmodel.User) error }
type Stors ¶
type Stors struct { ConversionStor ConversionStor FileStor FileStor ProjectStor ProjectStor TransferRequestFileStor TransferRequestFileStor TransferRequestStor TransferRequestStor GlobusTransferStor GlobusTransferStor UserStor UserStor }
type TransferRequestFileStor ¶
type TransferRequestFileStor interface { DeleteTransferFileRequestByPath(ownerID, projectID int, path string) error GetTransferFileRequestByPath(ownerID, projectID int, path string) (*mcmodel.TransferRequestFile, error) GetTransferRequestFileByPathForTransferRequest(path string, transferRequest *mcmodel.TransferRequest) (*mcmodel.TransferRequestFile, error) DeleteTransferRequestFile(transferRequestFile *mcmodel.TransferRequestFile) error }
type TransferRequestStor ¶
type TransferRequestStor interface { CreateTransferRequest(tr *mcmodel.TransferRequest) (*mcmodel.TransferRequest, error) ListTransferRequests() ([]mcmodel.TransferRequest, error) MarkFileReleased(file *mcmodel.File, checksum string, projectID int, totalBytes int64) error MarkFileAsOpen(file *mcmodel.File) error CreateNewFile(file, dir *mcmodel.File, transferRequest *mcmodel.TransferRequest) (*mcmodel.File, error) CreateNewFileVersion(file, dir *mcmodel.File, transferRequest *mcmodel.TransferRequest) (*mcmodel.File, error) ListDirectory(dir *mcmodel.File, transferRequest *mcmodel.TransferRequest) ([]mcmodel.File, error) GetFileByPath(path string, transferRequest *mcmodel.TransferRequest) (*mcmodel.File, error) GetTransferRequestForProjectAndUser(projectID, userID int) (*mcmodel.TransferRequest, error) GetTransferRequestsForProject(projectID int) ([]mcmodel.TransferRequest, error) GetTransferRequestByUUID(transferUUID string) (*mcmodel.TransferRequest, error) CloseTransferRequestByUUID(transferUUID string) error }