Get returns the session and port for a session ID. Used by DoConnect to get proxy port.
(sessionID string)
| 397 | |
| 398 | // Get returns the session and port for a session ID. Used by DoConnect to get proxy port. |
| 399 | func (s *Sessions) Get(sessionID string) (port int, ok bool) { |
| 400 | s.mu.RLock() |
| 401 | sess, ok := s.sessions[sessionID] |
| 402 | s.mu.RUnlock() |
| 403 | if !ok { |
| 404 | return 0, false |
| 405 | } |
| 406 | return sess.Port, true |
| 407 | } |
| 408 | |
| 409 | // Delete removes a session (e.g. when ticket is consumed and tunnel is done). |
| 410 | func (s *Sessions) Delete(sessionID string) { |
no outgoing calls
no test coverage detected