Skip to content

Commit cdde70d

Browse files
authored
use proxy interface (#18)
1 parent eaf3370 commit cdde70d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

jail.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import (
66
"log/slog"
77
"os/exec"
88
"time"
9-
10-
"github.com/coder/jail/proxy"
119
)
1210

1311
type Commander interface {
@@ -17,15 +15,20 @@ type Commander interface {
1715
Close() error
1816
}
1917

18+
type ProxyServer interface {
19+
Start(ctx context.Context) error
20+
Stop() error
21+
}
22+
2023
type Config struct {
2124
Commander Commander
22-
ProxyServer *proxy.ProxyServer
25+
ProxyServer ProxyServer
2326
Logger *slog.Logger
2427
}
2528

2629
type Jail struct {
2730
commandExecutor Commander
28-
proxyServer *proxy.ProxyServer
31+
proxyServer ProxyServer
2932
logger *slog.Logger
3033
cancel context.CancelFunc
3134
ctx context.Context

0 commit comments

Comments
 (0)