bufferedReconnectingPTY provides a reconnectable PTY by using a ring buffer to store scrollback.
| 20 | // bufferedReconnectingPTY provides a reconnectable PTY by using a ring buffer to store |
| 21 | // scrollback. |
| 22 | type bufferedReconnectingPTY struct { |
| 23 | command *pty.Cmd |
| 24 | |
| 25 | activeConns map[string]net.Conn |
| 26 | circularBuffer *circbuf.Buffer |
| 27 | |
| 28 | ptty pty.PTYCmd |
| 29 | process pty.Process |
| 30 | |
| 31 | metrics *prometheus.CounterVec |
| 32 | |
| 33 | state *ptyState |
| 34 | // timer will close the reconnecting pty when it expires. The timer will be |
| 35 | // reset as long as there are active connections. |
| 36 | timer *time.Timer |
| 37 | timeout time.Duration |
| 38 | } |
| 39 | |
| 40 | // newBuffered starts the buffered pty. If the context ends the process will be |
| 41 | // killed. |
nothing calls this directly
no outgoing calls
no test coverage detected