mirror of
https://github.com/jixishi/SerialTerminalForWindowsTerminal.git
synced 2026-06-16 00:52:44 +00:00
refactor: extract pkg/forward and pkg/luaplugin packages
Move ForwardManager → pkg/forward/Manager and PluginManager → pkg/luaplugin/Manager. Move FoeWardMode (now forward.Mode) with ParseMode/Network/String into pkg/forward. Rename constants: NOT→None, TCPC→TCP, UDPC→UDP. Update all references in main package. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+4
-2
@@ -6,6 +6,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/jixishi/SerialTerminalForWindowsTerminal/internal/event"
|
||||
"github.com/jixishi/SerialTerminalForWindowsTerminal/pkg/forward"
|
||||
"github.com/jixishi/SerialTerminalForWindowsTerminal/pkg/luaplugin"
|
||||
)
|
||||
|
||||
func setupTestPipes() {
|
||||
@@ -25,12 +27,12 @@ func setupTestPipes() {
|
||||
func newTestAppForCommand() *App {
|
||||
a := &App{
|
||||
cfg: &Config{inputCode: "UTF-8", outputCode: "UTF-8", endStr: "\n"},
|
||||
plugins: NewPluginManager(),
|
||||
plugins: luaplugin.NewManager(),
|
||||
uiEvents: make(chan event.UIEvent, 32),
|
||||
done: make(chan struct{}),
|
||||
}
|
||||
a.SetUIEnabled(true)
|
||||
a.forward = NewForwardManager(func([]byte) error { return nil }, func(string, ...any) {})
|
||||
a.forward = forward.NewManager(func([]byte) error { return nil }, func(string, ...any) {})
|
||||
a.dispatcher = NewCommandDispatcher(a)
|
||||
return a
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user