api

package
v0.0.0-...-9fc6fd2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToHttpError

func ToHttpError(err error) error

Types

type FileLoaderController

type FileLoaderController struct {
	// contains filtered or unexported fields
}

func NewFileLoaderController

func NewFileLoaderController(db store.DB) *FileLoaderController

func (*FileLoaderController) GetFilesLoadRequest

func (f *FileLoaderController) GetFilesLoadRequest(c echo.Context) error

func (*FileLoaderController) LoadFilesFromDirectory

func (f *FileLoaderController) LoadFilesFromDirectory(c echo.Context) error

LoadFilesFromDirectory accepts LoadFilesReq and creates a file load request in the file_loads table. The background file loader (see mc/cmd/mcserv/root.go) will pull items out of the database and process the load request.

type GlobusController

type GlobusController struct {
	// contains filtered or unexported fields
}

func NewGlobusController

func NewGlobusController(db store.DB, client *globusapi.Client, basePath, globusEndpointID string) *GlobusController

func (*GlobusController) CreateGlobusProjectDownload

func (g *GlobusController) CreateGlobusProjectDownload(c echo.Context) error

CreateGlobusProjectDownload creates a unique directory, sets up the projects directory structure and sets links to all its files for globus download. Additionally it adds an Globus "r" ACL to the directory so that only the requesting user can read from it (so that user only has read access, no other users have access to the directory.

func (*GlobusController) CreateGlobusUploadRequest

func (g *GlobusController) CreateGlobusUploadRequest(c echo.Context) error

CreateGlobusUploadRequests creates a new entry in the globus_uploads table that tracks to a directory on the materials commons globus endpoint that a user can upload to. The directory is created on the endpoint and that user has an ACL set on it to permit reading and writing to it. This directory is temporary and only available for the upload. Finally, this request will create a new background process record for the globus upload process (used by the other, background steps, to record the status/progress of the upload.

func (*GlobusController) GetGlobusUploadRequest

func (g *GlobusController) GetGlobusUploadRequest(c echo.Context) error

GetGlobusUploadRequest will retrieve the specified request so long as the user is the owner of the request, or the user has the Admin flag set to true

func (*GlobusController) ListGlobusUploadRequests

func (g *GlobusController) ListGlobusUploadRequests(c echo.Context) error

ListGlobusUploadRequests will retrieve all the upload requests for a specific user. Admin users can set user to "all" to retrieve all the known upload requests. Users can only retrieve their own upload requests unless they are an admin. Admins can retrieve other users requests.

type LoadFilesReq

type LoadFilesReq struct {
	ProjectID string   `json:"project_id"`
	User      string   `json:"user"`
	Path      string   `json:"path"`
	Exclude   []string `json:"exclude"`
}

type ServerStatus

type ServerStatus struct {
	NumCPUs       int    `json:"num_cpus"`
	NumGoRoutines int    `json:"num_go_routines"`
	GoVersion     string `json:"go_version"`
	Memory        uint64 `json:"memory"`
}

type StatusController

type StatusController struct {
}

func NewStatusController

func NewStatusController() *StatusController

func (*StatusController) GetServerStatus

func (s *StatusController) GetServerStatus(c echo.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL