MCPcopy
hub / github.com/mum4k/termdash / newTermdash

Function newTermdash

termdash.go:193–209  ·  view source on GitHub ↗

newTermdash creates a new termdash.

(t terminalapi.Terminal, c *container.Container, opts ...Option)

Source from the content-addressed store, hash-verified

191
192// newTermdash creates a new termdash.
193func 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.
212func (td *termdash) subscribers() {

Callers 2

RunFunction · 0.85
NewControllerFunction · 0.85

Calls 4

subscribersMethod · 0.95
NewDistributionSystemFunction · 0.92
setMethod · 0.65
SubscribeMethod · 0.45

Tested by

no test coverage detected