launchSession creates a new session using the launcher
(ctx context.Context)
| 300 | |
| 301 | // launchSession creates a new session using the launcher |
| 302 | func (cm *ConnManager) launchSession(ctx context.Context) (*Session, error) { |
| 303 | sessionCtx, cancel := context.WithCancel(ctx) |
| 304 | |
| 305 | session, err := cm.launcher.Launch(sessionCtx) |
| 306 | if err != nil { |
| 307 | cancel() |
| 308 | return nil, err |
| 309 | } |
| 310 | |
| 311 | // Store the cancel function in the session |
| 312 | session.Cancel = cancel |
| 313 | |
| 314 | return session, nil |
| 315 | } |
| 316 | |
| 317 | // GetCurrent returns the current primary session |
| 318 | func (cm *ConnManager) GetCurrent() *Session { |
no test coverage detected