feat: make PortRegistry interface segregation

This commit is contained in:
2026-07-13 02:42:21 +07:00
parent 43d1ec0e6d
commit f1df3d26c2
3 changed files with 19 additions and 13 deletions
+2 -3
View File
@@ -4,7 +4,6 @@ import (
"sync"
"testing"
"time"
"tunnel_pls/internal/port"
"tunnel_pls/internal/session/forwarder"
"tunnel_pls/internal/session/interaction"
"tunnel_pls/internal/session/lifecycle"
@@ -78,12 +77,12 @@ func (ml *mockLifecycle) Connection() ssh.Conn {
return args.Get(0).(ssh.Conn)
}
func (ml *mockLifecycle) PortRegistry() port.Port {
func (ml *mockLifecycle) PortRegistry() lifecycle.PortRegistry {
args := ml.Called()
if args.Get(0) == nil {
return nil
}
return args.Get(0).(port.Port)
return args.Get(0).(lifecycle.PortRegistry)
}
func (ml *mockLifecycle) SetChannel(channel ssh.Channel) error { return ml.Called(channel).Error(0) }