Function
newPollingDERPClient
(derpFn func() *tailcfg.DERPMap, logger slog.Logger)
Source from the content-addressed store, hash-verified
| 581 | } |
| 582 | |
| 583 | func newPollingDERPClient(derpFn func() *tailcfg.DERPMap, logger slog.Logger) tailnet.DERPClient { |
| 584 | ctx, cancel := context.WithCancel(context.Background()) |
| 585 | a := &pollingDERPClient{ |
| 586 | fn: derpFn, |
| 587 | ctx: ctx, |
| 588 | cancel: cancel, |
| 589 | logger: logger, |
| 590 | ch: make(chan *tailcfg.DERPMap), |
| 591 | loopDone: make(chan struct{}), |
| 592 | } |
| 593 | go a.pollDERP() |
| 594 | return a |
| 595 | } |
| 596 | |
| 597 | // pollingDERPClient is a DERP client that just calls a function on a polling |
| 598 | // interval |
Tested by
no test coverage detected