Documentation ¶
Index ¶
- func Join(path string, elements ...string) string
- func ToProjectPath(path string) string
- type Parser
- type ParserReleaser
- type Path
- type PathType
- type ProjectPath
- func (p *ProjectPath) FullPath() string
- func (p *ProjectPath) FullPathJoin(elements ...string) string
- func (p *ProjectPath) Join(elements ...string) string
- func (p *ProjectPath) List() ([]mcmodel.File, error)
- func (p *ProjectPath) Lookup() (*mcmodel.File, error)
- func (p *ProjectPath) PathType() PathType
- func (p *ProjectPath) ProjectID() int
- func (p *ProjectPath) ProjectPath() string
- func (p *ProjectPath) TransferBase() string
- func (p *ProjectPath) TransferID() int
- func (p *ProjectPath) TransferKey() string
- func (p *ProjectPath) TransferRequest() *mcmodel.TransferRequest
- func (p *ProjectPath) UserID() int
- type ProjectPathParser
- type Releaser
- type TransferPath
- func (p *TransferPath) FullPath() string
- func (p *TransferPath) List() ([]mcmodel.File, error)
- func (p *TransferPath) Lookup() (*mcmodel.File, error)
- func (p *TransferPath) PathType() PathType
- func (p *TransferPath) ProjectID() int
- func (p *TransferPath) ProjectPath() string
- func (p *TransferPath) TransferBase() string
- func (p *TransferPath) TransferID() int
- func (p *TransferPath) TransferKey() string
- func (p *TransferPath) TransferRequest() *mcmodel.TransferRequest
- func (p *TransferPath) UserID() int
- type TransferPathParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Join ¶
Join takes a path that contains the project/user portions and returns the project path portion joined with elements. For example "/project-uuid/user-uuid/rest/of/path" joined with "dir1", "file.txt" will return "/rest/of/path/dir1/file.txt".
func ToProjectPath ¶
ToProjectPath takes a path that contains the project/user portions and returns the project path. For example "/25/301/rest/of/path" will return "/rest/of/path".
Types ¶
type ParserReleaser ¶
func NewTransferPathParser ¶
func NewTransferPathParser(stors *stor.Stors, trCache *fsstate.TransferRequestCache) ParserReleaser
type ProjectPath ¶
type ProjectPath struct {
// contains filtered or unexported fields
}
ProjectPath represents the different parts of a project path in the file system. Each project/user gets a unique path for upload/download. The path starts with the project ID and user ID, eg /25/301. The rest of the path is the directory tree for that project. In the database paths are stored without the project/user id, eg /25/301/dir1/file.txt has path /dir1/file.txt.
The methods for ProjectPath help with these two representations
func (*ProjectPath) FullPath ¶
func (p *ProjectPath) FullPath() string
func (*ProjectPath) FullPathJoin ¶
func (p *ProjectPath) FullPathJoin(elements ...string) string
FullPathJoin will return the joined path elements onto the ProjectPath.FullPath, for example if ProjectPath.FullPath is "/25/301/dir1/dir2", and you join "dir3", "file.txt" it will return "/25/301/dir1/dir2/dir3/file.txt".
func (*ProjectPath) Join ¶
func (p *ProjectPath) Join(elements ...string) string
Join will return the joined path elements onto the ProjectPath.ProjectPath, for example if ProjectPath.ProjectPath is "/dir1/dir2", and you join "dir3", "file.txt" it will return "/dir1/dir2/dir3/file.txt".
func (*ProjectPath) PathType ¶
func (p *ProjectPath) PathType() PathType
func (*ProjectPath) ProjectID ¶
func (p *ProjectPath) ProjectID() int
func (*ProjectPath) ProjectPath ¶
func (p *ProjectPath) ProjectPath() string
func (*ProjectPath) TransferBase ¶
func (p *ProjectPath) TransferBase() string
func (*ProjectPath) TransferID ¶
func (p *ProjectPath) TransferID() int
func (*ProjectPath) TransferKey ¶
func (p *ProjectPath) TransferKey() string
func (*ProjectPath) TransferRequest ¶
func (p *ProjectPath) TransferRequest() *mcmodel.TransferRequest
func (*ProjectPath) UserID ¶
func (p *ProjectPath) UserID() int
type ProjectPathParser ¶
type ProjectPathParser struct {
// contains filtered or unexported fields
}
func NewProjectPathParser ¶
func NewProjectPathParser(stors *stor.Stors) *ProjectPathParser
func (*ProjectPathParser) Parse ¶
func (p *ProjectPathParser) Parse(path string) (Path, error)
Parse takes a path containing the project and user uuid and creates a ProjectPath structure containing the various parts of the path. A path consists of /project-id/user-id/rest/of/path. From this path it constructs ProjectPath that would look as follows for /25/301/rest/of/path
&ProjecPath{ ProjectID: 25 UserUUID: 301 ProjectPath: /rest/of/path FullPath: /25/301/rest/of/path }
type TransferPath ¶
type TransferPath struct {
// contains filtered or unexported fields
}
func (*TransferPath) FullPath ¶
func (p *TransferPath) FullPath() string
func (*TransferPath) PathType ¶
func (p *TransferPath) PathType() PathType
func (*TransferPath) ProjectID ¶
func (p *TransferPath) ProjectID() int
func (*TransferPath) ProjectPath ¶
func (p *TransferPath) ProjectPath() string
func (*TransferPath) TransferBase ¶
func (p *TransferPath) TransferBase() string
func (*TransferPath) TransferID ¶
func (p *TransferPath) TransferID() int
func (*TransferPath) TransferKey ¶
func (p *TransferPath) TransferKey() string
func (*TransferPath) TransferRequest ¶
func (p *TransferPath) TransferRequest() *mcmodel.TransferRequest
func (*TransferPath) UserID ¶
func (p *TransferPath) UserID() int
type TransferPathParser ¶
type TransferPathParser struct {
// contains filtered or unexported fields
}
func (*TransferPathParser) Release ¶
func (p *TransferPathParser) Release(path string)
TODO: Can this be removed?