newTermdash creates a new termdash.
(t terminalapi.Terminal, c *container.Container, opts ...Option)
| 191 | |
| 192 | // newTermdash creates a new termdash. |
| 193 | func newTermdash(t terminalapi.Terminal, c *container.Container, opts ...Option) *termdash { |
| 194 | td := &termdash{ |
| 195 | term: t, |
| 196 | container: c, |
| 197 | eds: event.NewDistributionSystem(), |
| 198 | closeCh: make(chan struct{}), |
| 199 | exitCh: make(chan struct{}), |
| 200 | redrawInterval: DefaultRedrawInterval, |
| 201 | } |
| 202 | |
| 203 | for _, opt := range opts { |
| 204 | opt.set(td) |
| 205 | } |
| 206 | td.subscribers() |
| 207 | c.Subscribe(td.eds) |
| 208 | return td |
| 209 | } |
| 210 | |
| 211 | // subscribers subscribes event receivers that live in this package to EDS. |
| 212 | func (td *termdash) subscribers() { |
no test coverage detected