{"modulePath":"github.com/apache/airavata","version":"v1.0.0-alpha1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package controller\n\nPackage controller serves the process routes: the process itself, its status history and its tasks.\n\nThere are no routes for a batch process. What a BATCH\\_JOB run needs is configured in the batchProcess section of a process body and read back nested in the process response, so every operation on it goes through the process it belongs to.\n\n## Types\n\n```go\ntype LaunchController struct {\n\t// contains filtered or unexported fields\n}\n```\nLaunchController serves the launch action on /api/v1/processes/{processId}.\n\nLaunching is a verb rather than a resource: it has no body, nothing is addressable afterwards under /launch, and what it produces is read back through the process's task collections. Hence the one POST, and no CRUD alongside it.\n\n```go\nfunc NewLaunchController(svc *service.LaunchService) *LaunchController\n```\nNewLaunchController returns a handler delegating to svc.\n\n```go\nfunc (h *LaunchController) Register(mux *http.ServeMux)\n```\nRegister mounts the launch and retry routes. Their literal segments cannot collide with the task collections beside them, so no ordering is implied.\n\n```go\ntype LinkController struct {\n\t// contains filtered or unexported fields\n}\n```\nLinkController serves the routes that make Airavata a process's Linkspan control plane: the link Linkspan dials, the owner's Jupyter access, and the Jupyter proxy.\n\nThe link and the proxy sit outside bearer authentication, each opened by a secret issued to the process: the link by its link token, offered as a WebSocket subprotocol, and the proxy by its Jupyter token, which Jupyter clients send as \"Authorization: token …\" or, on WebSockets, as ?token=. Neither header is a bearer token, so the auth middleware lets both through as anonymous.\n\n```go\nfunc NewLinkController(svc *service.LinkService) *LinkController\n```\nNewLinkController returns a handler delegating to svc.\n\n```go\nfunc (h *LinkController) Register(mux *http.ServeMux)\n```\nRegister mounts the link routes.\n\n```go\ntype ProcessController struct {\n\t// contains filtered or unexported fields\n}\n```\nProcessController serves /api/v1/processes.\n\n```go\nfunc NewProcessController(svc *service.ProcessService) *ProcessController\n```\nNewProcessController returns a handler delegating to svc.\n\n```go\nfunc (h *ProcessController) Register(mux *http.ServeMux)\n```\nRegister mounts the process routes.\n\n```go\ntype StatusController struct {\n\t// contains filtered or unexported fields\n}\n```\nStatusController serves read-only access to a process's status history, nested under /api/v1/processes/{processId}.\n\nThere is deliberately no POST or PUT: statuses are recorded internally by service.StatusService — from process submission and from whatever submits and monitors the actual job — never accepted as a request body from a client.\n\n```go\nfunc NewStatusController(svc *service.StatusService) *StatusController\n```\nNewStatusController returns a handler delegating to svc.\n\n```go\nfunc (h *StatusController) Register(mux *http.ServeMux)\n```\nRegister mounts the read-only status routes.\n\n```go\ntype TaskController[T any, Req any, Res any] struct {\n\t// contains filtered or unexported fields\n}\n```\nTaskController serves one kind of task nested under /api/v1/processes/{processId}.\n\nThe four kinds are the same five routes over a different payload, so the handlers are written once and instantiated per kind. What differs is supplied at construction: the collection's path segment and how a row is rendered.\n\n```go\nfunc NewDataStagingTaskController(svc *service.DataStagingTaskService) *TaskController[model.DataStagingTask, dto.DataStagingTaskRequest, dto.DataStagingTaskResponse]\n```\nNewDataStagingTaskController serves .../data-staging-tasks.\n\n```go\nfunc NewInteractiveCommandTaskController(svc *service.InteractiveCommandTaskService) *TaskController[model.InteractiveCommandTask, dto.InteractiveCommandTaskRequest, dto.InteractiveCommandTaskResponse]\n```\nNewInteractiveCommandTaskController serves .../interactive-command-tasks.\n\n```go\nfunc NewJobMonitoringTaskController(svc *service.JobMonitoringTaskService) *TaskController[model.JobMonitoringTask, dto.JobMonitoringTaskRequest, dto.JobMonitoringTaskResponse]\n```\nNewJobMonitoringTaskController serves .../job-monitoring-tasks.\n\n```go\nfunc NewJobSubmissionTaskController(svc *service.JobSubmissionTaskService) *TaskController[model.JobSubmissionTask, dto.JobSubmissionTaskRequest, dto.JobSubmissionTaskResponse]\n```\nNewJobSubmissionTaskController serves .../job-submission-tasks.\n\n```go\nfunc (h *TaskController[T, Req, Res]) Register(mux *http.ServeMux)\n```\nRegister mounts the task routes for this kind.\n\n```go\ntype TaskStatusController struct {\n\t// contains filtered or unexported fields\n}\n```\nTaskStatusController serves read-only access to the status history of a process's tasks, nested under /api/v1/processes/{processId}.\n\nOne route covers all four task kinds: a status names its kind, so a client reads the whole run's task history in one call rather than one per kind.\n\n```go\nfunc NewTaskStatusController(svc *service.TaskStatusService) *TaskStatusController\n```\nNewTaskStatusController returns a handler delegating to svc.\n\n```go\nfunc (h *TaskStatusController) Register(mux *http.ServeMux)\n```\nRegister mounts the read-only task status routes.\n\n```go\ntype WorkflowController struct {\n\t// contains filtered or unexported fields\n}\n```\nWorkflowController serves read-only access to the workflows started for a process, nested under /api/v1/processes/{processId}.\n\nThere is deliberately no POST or PUT: workflows are recorded by service.WorkflowService when a workflow is started, never accepted as a request body from a client.\n\n```go\nfunc NewWorkflowController(svc *service.WorkflowService) *WorkflowController\n```\nNewWorkflowController returns a handler delegating to svc.\n\n```go\nfunc (h *WorkflowController) Register(mux *http.ServeMux)\n```\nRegister mounts the read-only workflow routes.\n\n","path":"github.com/apache/airavata/api/process/controller","name":"controller","synopsis":"Package controller serves the process routes: the process itself, its status history and its tasks.","isRedistributable":true}
