MCPcopy Index your code
hub / github.com/coder/coder / StopDesktopRecording

Method StopDesktopRecording

codersdk/workspacesdk/agentconn.go:760–776  ·  view source on GitHub ↗

StopDesktopRecording stops a desktop recording session on the agent and returns the recording as a StopDesktopRecordingResponse. The response body is a multipart/mixed stream containing the video (and optionally a JPEG thumbnail). The caller is responsible for closing the returned Body. Idempotent —

(ctx context.Context, req StopDesktopRecordingRequest)

Source from the content-addressed store, hash-verified

758// responsible for closing the returned Body. Idempotent — safe
759// to call on an already-stopped recording.
760func (c *agentConn) StopDesktopRecording(ctx context.Context, req StopDesktopRecordingRequest) (StopDesktopRecordingResponse, error) {
761 ctx, span := tracing.StartSpan(ctx)
762 defer span.End()
763 res, err := c.apiRequest(ctx, http.MethodPost, "/api/v0/desktop/recording/stop", req)
764 if err != nil {
765 return StopDesktopRecordingResponse{}, xerrors.Errorf("stop recording request: %w", err)
766 }
767 if res.StatusCode != http.StatusOK {
768 defer res.Body.Close()
769 return StopDesktopRecordingResponse{}, codersdk.ReadBodyAsError(res)
770 }
771 // Caller is responsible for closing res.Body.
772 return StopDesktopRecordingResponse{
773 Body: res.Body,
774 ContentType: res.Header.Get("Content-Type"),
775 }, nil
776}
777
778// DeleteDevcontainer deletes the provided devcontainer.
779// This is a blocking call and will wait for the container to be deleted.

Callers

nothing calls this directly

Calls 6

apiRequestMethod · 0.95
StartSpanFunction · 0.92
ReadBodyAsErrorFunction · 0.92
CloseMethod · 0.65
GetMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected