Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FileFields fileFields
File contains methods to get the json fields names for a File
var Files fs
Files gives access to helper routines that work on lists of files.
var Uploads uploadList
Uploads gives access to helper routines that work on lists of uploads.
Functions ¶
Types ¶
type Access ¶
type Access struct {
ID string `gorethink:"id,omitempty"`
Dataset string `gorethink:"dataset"`
Birthtime time.Time `gorethink:"birthtime"`
MTime time.Time `gorethink:"mtime"`
Permissions string `gorethink:"permissions"`
ProjectID string `gorethink:"project_id"`
ProjectName string `gorethink:"project_name"`
Status string `gorethink:"status"`
UserID string `gorethink:"user_id"`
}
type DataDir2DataFile ¶
type DataDir2DataFile struct {
ID string `gorethink:"id,omitempty"`
DataDirID string `gorethink:"datadir_id"`
DataFileID string `gorethink:"datafile_id"`
}
DataDir2DataFile is a join table that maps datadirs to their files.
type Directory ¶
type Directory struct {
ID string `gorethink:"id,omitempty" json:"id"`
Type string `gorethink:"otype" json:"otype"`
Owner string `gorethink:"owner" json:"owner"`
Name string `gorethink:"name" json:"name"`
Project string `gorethink:"project" json:"project"`
Parent string `gorethink:"parent" json:"parent"`
Birthtime time.Time `gorethink:"birthtime" json:"birthtime"`
MTime time.Time `gorethink:"mtime" json:"mtime"`
ATime time.Time `gorethink:"atime" json:"mtime"`
}
Directory models a directory of user files. A dir is an abstract representation of a users file system directory plus the metadata needed by the system.
func NewDirectory ¶
NewDirectory creates a new Directory instance.
type File ¶
type File struct {
ID string `gorethink:"id,omitempty" json:"id"` // Primary key.
Type string `gorethink:"otype" json:"otype"` // Type
Current bool `gorethink:"current" json:"current"` // Is this the most current version.
Name string `gorethink:"name" json:"name"` // Name of file.
Path string `gorethink:"path,omitempty" json:"path"` // Directory path where file resides.
Birthtime time.Time `gorethink:"birthtime" json:"birthtime"` // Creation time.
MTime time.Time `gorethink:"mtime" json:"mtime"` // Modification time.
ATime time.Time `gorethink:"atime" json:"atime"` // Last access time.
Description string `gorethink:"description" json:"description"` // Description of file
MediaType MediaType `gorethink:"mediatype" json:"mediatype"` // File media type and description
Owner string `gorethink:"owner" json:"owner"` // Who owns the file.
Checksum string `gorethink:"checksum" json:"checksum"` // MD5 Hash.
Size int64 `gorethink:"size" json:"size"` // Size of file.
Uploaded int64 `gorethink:"uploaded" json:"-"` // Number of bytes uploaded. When Size != Uploaded file is only partially uploaded.
Parent string `gorethink:"parent" json:"parent"` // If there are multiple ids then parent is the id of the previous version.
UsesID string `gorethink:"usesid" json:"usesid"` // If file is a duplicate, then usesid points to the real file. This allows multiple files to share a single physical file.
}
File models a user file. A datafile is an abstract representation of a real file plus the attributes that we need in our model for access, and other metadata.
type FileUpload ¶
type FileUpload struct {
Name string `gorethink:"name"` // File name on remote system
Checksum string `gorethink:"checksum"` // Computed file checksum
Size int64 `gorethink:"size"` // Size of file on remote system
Birthtime time.Time `gorethink:"birthtime"` // When was FileUpload started
MTime time.Time `gorethink:"mtime"` // Last time this entry was modified
RemoteMTime time.Time `gorethink:"remote_mtime"` // CTime of the remote file
ChunkSize int `gorethink:"chunk_size"` // Chunk transfer size
ChunkCount int `gorethink:"chunk_count"` // Number of chunks expected
BitString []byte `gorethink:"bitstring"` // bit string representation of blocks
Blocks *bitset.BitSet // Block state. If set block as has been uploaded
}
FileUpload is the tracking information for an individual file upload.
type Group ¶
type Group struct {
ID string `gorethink:"id,omitempty"`
Owner string `gorethink:"owner"`
Name string `gorethink:"name"`
Description string `gorethink:"description"`
Birthtime time.Time `gorethink:"birthtime"`
MTime time.Time `gorethink:"mtime"`
Access string `gorethink:"access"`
Users []string `gorethink:"users"`
}
Group models users groups and access permissions to user data.
type MediaType ¶
type MediaType struct {
Mime string `gorethink:"mime" json:"mime"` // The MIME type
Description string `gorethink:"description" json:"description"` // Description of MIME type
// MIME Description translated to human readable format
MimeDescription string `gorethink:"mime_description" json:"mime_description"`
}
MediaType describes the mime media type and its description.
type MediaTypeSummary ¶
type Note ¶
type Note struct {
Date string `gorethink:"date"`
Message string `gorethink:"message"`
Who string `gorethink:"who"`
}
Note represents a note entry.
type Project ¶
type Project struct {
ID string `gorethink:"id,omitempty"`
Type string `gorethink:"otype" json:"otype"`
Name string `gorethink:"name"`
Description string `gorethink:"description"`
DataDir string `gorethink:"datadir" db:"-"`
Owner string `gorethink:"owner" db:"-"`
Birthtime time.Time `gorethink:"birthtime"`
MTime time.Time `gorethink:"mtime"`
MediaTypes map[string]MediaTypeSummary `gorethink:"mediatypes" json:"mediatypes"`
Size int64 `gorethink:"size" json:"size"`
}
Project models a users project. A project is an instance of a users workspace where they conduct their research. A project can be shared.
func NewProject ¶
NewProject creates a new Project instance.
type Project2DataDir ¶
type Project2DataDir struct {
ID string `gorethink:"id,omitempty" db:"-"`
ProjectID string `gorethink:"project_id" db:"project_id"`
DataDirID string `gorethink:"datadir_id" db:"datadir_id"`
}
Project2DataDir is a join table that maps projects to their datadirs.
type Project2DataFile ¶
type Project2DataFile struct {
ID string `gorethink:"id,omitempty"`
ProjectID string `gorethink:"project_id"`
DataFileID string `gorethink:"datafile_id"`
}
Project2DataFile is a join table that maps projects to their files.
type Sample2DataFile ¶
type Sample2DataFile struct {
ID string `gorethink:"id"`
SampleID string `gorethink:"sample_id"`
DataFileID string `gorethink:"datafile_id"`
}
Sample2DataFile is a join table that maps samples to their files.
type Upload ¶
type Upload struct {
ID string `gorethink:"id,omitempty"`
Owner string `gorethink:"owner"` // Who started the upload
DirectoryID string `gorethink:"directory_id"` // Directory to upload to
DirectoryName string `gorethink:"directory_name"` // Name of directory
ProjectID string `gorethink:"project_id"` // Project to upload to
ProjectOwner string `gorethink:"project_owner"` // Owner of project
ProjectName string `gorethink:"project_name"` // Name of project
Birthtime time.Time `gorethink:"birthtime"` // When was upload started
Host string `gorethink:"host"` // Host requesting the upload
File FileUpload `gorethink:"file"` // File being uploaded
IsExisting bool `gorethink:"is_existing"` // Is this an upload request that matches an uploaded file
ServerRestarted bool `gorethink:"server_restart"` // Has the server been restarted since upload was created?
}
A Upload models a user upload request. It allows for users to restart upload requests.
func (*Upload) SetFBlocks ¶
SetFBlocks sets the blocks and BitString. It does nothing if blocks is nil.
type User ¶
type User struct {
ID string `gorethink:"id,omitempty" json:"id"`
Email string `gorethink:"email" json:"email"`
Admin bool `gorethink:"admin" json:"admin"`
Fullname string `gorethink:"fullname" json:"fullname"`
Password string `gorethink:"password" json:"-"`
APIKey string `gorethink:"apikey" json:"-"`
Birthtime time.Time `gorethink:"birthtime" json:"birthtime"`
MTime time.Time `gorethink:"mtime" json:"mtime"`
Avatar string `gorethink:"avatar" json:"avatar"`
Description string `gorethink:"description" json:"description"`
Affiliation string `gorethink:"affiliation" json:"affiliation"`
HomePage string `gorethink:"homepage" json:"homepage"`
Type string `gorethink:"otype" json:"otype"`
}
User models a user in the system.