(opts *remote.SSHOpts, createIfNotExists bool)
| 1065 | } |
| 1066 | |
| 1067 | func getConnInternal(opts *remote.SSHOpts, createIfNotExists bool) *SSHConn { |
| 1068 | globalLock.Lock() |
| 1069 | defer globalLock.Unlock() |
| 1070 | rtn := clientControllerMap[*opts] |
| 1071 | if rtn == nil && createIfNotExists { |
| 1072 | rtn = &SSHConn{ |
| 1073 | lock: &sync.Mutex{}, |
| 1074 | lifecycleLock: &sync.Mutex{}, |
| 1075 | Status: Status_Init, |
| 1076 | ConnHealthStatus: ConnHealthStatus_Good, |
| 1077 | WshEnabled: &atomic.Bool{}, |
| 1078 | Opts: opts, |
| 1079 | } |
| 1080 | clientControllerMap[*opts] = rtn |
| 1081 | } |
| 1082 | return rtn |
| 1083 | } |
| 1084 | |
| 1085 | // does NOT connect, does not return nil |
| 1086 | func GetConn(opts *remote.SSHOpts) *SSHConn { |
no outgoing calls
no test coverage detected