fix(portforward): rework run loop and fix deadlocks (#1874)

This commit is contained in:
Quentin McGaw
2023-09-23 12:57:12 +02:00
committed by GitHub
parent c435bbb32c
commit 71201411f4
30 changed files with 453 additions and 476 deletions

View File

@@ -1,10 +1,20 @@
package portforward
import (
"context"
)
import "context"
type Service interface {
Start(ctx context.Context) (runError <-chan error, err error)
Stop() (err error)
GetPortForwarded() (port uint16)
}
type PortAllower interface {
SetAllowedPort(ctx context.Context, port uint16, intf string) (err error)
RemoveAllowedPort(ctx context.Context, port uint16) (err error)
}
type Logger interface {
Info(s string)
Warn(s string)
Error(s string)
}