(sessionID, cwd string, state *agent.AgentState)
| 88 | m.mu.Lock() |
| 89 | defer m.mu.Unlock() |
| 90 | return len(m.sessions) |
| 91 | } |
| 92 | |
| 93 | func (m *SessionManager) ActiveSessionIDs() map[string]struct{} { |
| 94 | m.mu.Lock() |
| 95 | defer m.mu.Unlock() |
| 96 | out := map[string]struct{}{} |
| 97 | for id := range m.sessions { |
| 98 | out[id] = struct{}{} |
| 99 | } |
| 100 | return out |
| 101 | } |
| 102 | |
| 103 | func (m *SessionManager) StorageStatus() (maintenance.Report, error) { |
| 104 | return maintenance.Status(m.baseConfig, maintenance.Options{CurrentSessions: m.ActiveSessionIDs()}) |
| 105 | } |
| 106 | |
| 107 | func (m *SessionManager) CleanupStorage(enforce bool) (maintenance.Report, error) { |
| 108 | return maintenance.Cleanup(m.baseConfig, maintenance.Options{Enforce: enforce, CurrentSessions: m.ActiveSessionIDs()}) |
| 109 | } |
| 110 | |
| 111 | func (m *SessionManager) Pin(sessionID string, pinned bool) (*session.Meta, error) { |
| 112 | return m.store.Pin(sessionID, pinned) |
| 113 | } |
no test coverage detected