| 11 | ) |
| 12 | |
| 13 | type Loop struct { |
| 14 | // State |
| 15 | settings Settings |
| 16 | settingsMutex sync.RWMutex |
| 17 | service Service |
| 18 | // Fixed injected objects |
| 19 | routing Routing |
| 20 | client *http.Client |
| 21 | portAllower PortAllower |
| 22 | logger Logger |
| 23 | cmder Cmder |
| 24 | // Fixed parameters |
| 25 | uid, gid int |
| 26 | // Internal channels and locks |
| 27 | // runCtx is used to detect when the loop has exited |
| 28 | // when performing an update |
| 29 | runCtx context.Context //nolint:containedctx |
| 30 | runCancel context.CancelFunc |
| 31 | runDone <-chan struct{} |
| 32 | updateTrigger chan<- Settings |
| 33 | updatedResult <-chan error |
| 34 | } |
| 35 | |
| 36 | func NewLoop(settings settings.PortForwarding, routing Routing, |
| 37 | client *http.Client, portAllower PortAllower, |
nothing calls this directly
no outgoing calls
no test coverage detected