Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles concurrent access to PTY sessions
func GetManager ¶
func GetManager() *Manager
GetManager returns the singleton instance of the session manager. It initializes the manager on first call using sync.Once.
func (*Manager) AddSession ¶
AddSession adds a new PTY session to the manager. It acquires a write lock to safely add the session to the map.
func (*Manager) GetSession ¶
GetSession retrieves a session by its ID. It returns the session and a boolean indicating if it exists. Uses a read lock since it doesn't modify the sessions map.
func (*Manager) ListSessions ¶
ListSessions returns a list of active session IDs. It acquires a read lock since it only reads from the sessions map. Returns a slice containing all session IDs.
func (*Manager) RemoveSession ¶
RemoveSession removes a session from the manager. It acquires a write lock to safely delete the session from the map.