mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat: Add streaming endpoint for workspace history (#157)
* feat: Add parameter querying to the API * feat: Add streaming endpoint for workspace history Enables a buildlog-like flow for reading job output. * Fix empty parameter source and destination * Add comment for usage of workspace history logs endpoint
This commit is contained in:
@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/go-chi/render"
|
||||
"github.com/google/uuid"
|
||||
"github.com/moby/moby/pkg/namesgenerator"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/coder/coder/database"
|
||||
@ -155,6 +156,7 @@ func (api *api) postWorkspaceHistoryByUser(rw http.ResponseWriter, r *http.Reque
|
||||
WorkspaceID: workspace.ID,
|
||||
ProjectHistoryID: projectHistory.ID,
|
||||
BeforeID: priorHistoryID,
|
||||
Name: namesgenerator.GetRandomName(1),
|
||||
Initiator: user.ID,
|
||||
Transition: createBuild.Transition,
|
||||
ProvisionJobID: provisionerJob.ID,
|
||||
@ -253,7 +255,3 @@ func convertWorkspaceHistory(workspaceHistory database.WorkspaceHistory, provisi
|
||||
Provision: convertProvisionerJob(provisionerJob),
|
||||
})
|
||||
}
|
||||
|
||||
func workspaceHistoryLogsChannel(workspaceHistoryID uuid.UUID) string {
|
||||
return fmt.Sprintf("workspace-history-logs:%s", workspaceHistoryID)
|
||||
}
|
||||
|
Reference in New Issue
Block a user