handlers

package
v0.0.0-...-33a8802 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context api.Context

Context is the placeholder for the common API context struct.

func (Context) DatasetsByIDGet

func (apiContext Context) DatasetsByIDGet(w http.ResponseWriter, r *http.Request)

DatasetsByIDGet returns a specific dataset by ID.

func (Context) DatasetsByIDPatch

func (apiContext Context) DatasetsByIDPatch(w http.ResponseWriter, r *http.Request)

DatasetsByIDPatch updates fields of a specific dataset by ID.

func (Context) DatasetsDownloadHandler

func (apiContext Context) DatasetsDownloadHandler(basePath string) http.HandlerFunc

DatasetsDownloadHandler handles all dataset download requests.

func (Context) DatasetsGet

func (apiContext Context) DatasetsGet(w http.ResponseWriter, r *http.Request)

DatasetsGet returns all (visible) datasets.

func (Context) DatasetsPost

func (apiContext Context) DatasetsPost(w http.ResponseWriter, r *http.Request)

DatasetsPost creates a new dataset specified in the request body.

func (Context) DatasetsUploadHandler

func (apiContext Context) DatasetsUploadHandler(basePath string) http.HandlerFunc

DatasetsUploadHandler handles all data upload related requests.

func (Context) JobsByIDGet

func (apiContext Context) JobsByIDGet(w http.ResponseWriter, r *http.Request)

JobsByIDGet returns a specific job by ID.

func (Context) JobsByIDPatch

func (apiContext Context) JobsByIDPatch(w http.ResponseWriter, r *http.Request)

JobsByIDPatch updates fields of a specific job by ID.

func (Context) JobsGet

func (apiContext Context) JobsGet(w http.ResponseWriter, r *http.Request)

JobsGet returns all (visible) jobs.

func (Context) JobsPost

func (apiContext Context) JobsPost(w http.ResponseWriter, r *http.Request)

JobsPost creates a new job specified in the request body.

func (Context) ModulesByIDGet

func (apiContext Context) ModulesByIDGet(w http.ResponseWriter, r *http.Request)

ModulesByIDGet returns a specific module by ID.

func (Context) ModulesByIDPatch

func (apiContext Context) ModulesByIDPatch(w http.ResponseWriter, r *http.Request)

ModulesByIDPatch updates fields of a specific module by ID.

func (Context) ModulesGet

func (apiContext Context) ModulesGet(w http.ResponseWriter, r *http.Request)

ModulesGet returns all (visible) modules.

func (Context) ModulesPost

func (apiContext Context) ModulesPost(w http.ResponseWriter, r *http.Request)

ModulesPost creates a new module specified in the request body.

func (Context) ModulesUploadHandler

func (apiContext Context) ModulesUploadHandler(basePath string) http.HandlerFunc

ModulesUploadHandler handles all data upload related requests.

func (Context) ProcessesGet

func (apiContext Context) ProcessesGet(w http.ResponseWriter, r *http.Request)

ProcessesGet returns all (visible) processes.

func (Context) ProcesssesByIDGet

func (apiContext Context) ProcesssesByIDGet(w http.ResponseWriter, r *http.Request)

ProcesssesByIDGet returns a specific process by ID.

func (Context) ServeLocalResource

func (apiContext Context) ServeLocalResource(dataPath, relativePath string, modtime time.Time, w http.ResponseWriter, r *http.Request)

ServeLocalResource is a utility function that accepts a path to a local resource (file or directory) and serves it. The path is given in two parts - as a base path (dataPath) and the relative path (relativePath). A file is served directly. A directory is served depending on the way it is specified. If the resource path has a suffix (.tar, .tar.gz or .zip) then the directory is packed into an archive. Otherwise, the we return a JSON response with fields "path" for relative path, "files" for file names and "directories" for directory names. We must also specify the modtime argument which is required for caching purposes.

func (Context) TaskDataDownloadHandler

func (apiContext Context) TaskDataDownloadHandler(basePath string, dataSubdir string) http.HandlerFunc

TaskDataDownloadHandler handles all task prediction download requests.

func (Context) TaskImageDownload

func (apiContext Context) TaskImageDownload(w http.ResponseWriter, r *http.Request)

TaskImageDownload bulds a trained model Docker image and returns it as a tar archive.

func (Context) TasksByIDGet

func (apiContext Context) TasksByIDGet(w http.ResponseWriter, r *http.Request)

TasksByIDGet returns a specific task by ID.

func (Context) TasksGet

func (apiContext Context) TasksGet(w http.ResponseWriter, r *http.Request)

TasksGet returns all (visible) tasks.

func (Context) UsersByIDGet

func (apiContext Context) UsersByIDGet(w http.ResponseWriter, r *http.Request)

UsersByIDGet returns a specific user by ID.

func (Context) UsersByIDPatch

func (apiContext Context) UsersByIDPatch(w http.ResponseWriter, r *http.Request)

UsersByIDPatch updates fields of a specific user by ID.

func (Context) UsersGet

func (apiContext Context) UsersGet(w http.ResponseWriter, r *http.Request)

UsersGet returns all (visible) users.

func (Context) UsersLoginGet

func (apiContext Context) UsersLoginGet(w http.ResponseWriter, r *http.Request)

UsersLoginGet logs a user in given their credentials and returns an API key.

func (Context) UsersLogoutGet

func (apiContext Context) UsersLogoutGet(w http.ResponseWriter, r *http.Request)

UsersLogoutGet logs a user out and erases their API key from the database.

func (Context) UsersPost

func (apiContext Context) UsersPost(w http.ResponseWriter, r *http.Request)

UsersPost creates a new user specified in the request body.

Jump to

Keyboard shortcuts

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