(w http.ResponseWriter, r *http.Request)
| 320 | } |
| 321 | |
| 322 | func (s Server) createSession(w http.ResponseWriter, r *http.Request) { |
| 323 | var req struct { |
| 324 | LeaseID string `json:"lease_id"` |
| 325 | } |
| 326 | if !decodeJSON(w, r, &req) { |
| 327 | return |
| 328 | } |
| 329 | s.lockWrites() |
| 330 | defer s.unlockWrites() |
| 331 | id, err := s.control().CreateSession(req.LeaseID) |
| 332 | writeResult(w, map[string]any{"session_id": id}, err) |
| 333 | } |
| 334 | |
| 335 | func (s Server) listSessions(w http.ResponseWriter, r *http.Request) { |
| 336 | items, err := s.control().ListSessions() |
nothing calls this directly
no test coverage detected