MCPcopy Create free account
hub / github.com/docker/docker-agent / getSessionSnapshot

Method getSessionSnapshot

pkg/server/server.go:322–328  ·  view source on GitHub ↗

getSessionSnapshot returns the full state of a session in one response (stored fields + live runtime state + last event sequence number) so a client can rebuild its view and then tail /events?since= without missing any transition.

(c echo.Context)

Source from the content-addressed store, hash-verified

320// client can rebuild its view and then tail /events?since=<last_event_seq>
321// without missing any transition.
322func (s *Server) getSessionSnapshot(c echo.Context) error {
323 snapshot, err := s.sm.GetSessionSnapshot(c.Request().Context(), c.Param("id"))
324 if err != nil {
325 return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("session not found: %v", err))
326 }
327 return c.JSON(http.StatusOK, snapshot)
328}
329
330func (s *Server) resumeSession(c echo.Context) error {
331 var req api.ResumeSessionRequest

Callers

nothing calls this directly

Calls 2

GetSessionSnapshotMethod · 0.80
ContextMethod · 0.80

Tested by

no test coverage detected