[agent] - bastion mode init

This commit is contained in:
zeaslity
2024-04-17 15:02:41 +08:00
parent d54ebfc7b0
commit c0712b7325
3 changed files with 160 additions and 0 deletions

View File

@@ -72,9 +72,23 @@ func BastionModeInit() {
// build for socks server
words := []string{"apple", "apricot", "apprentice", "application"}
t := bastion_init.NewTrie()
t.InsertAll(words)
prefix := "ap"
closest, err := bastion_init.FindClosestWord(t, prefix)
if err != nil {
fmt.Println(err)
} else {
fmt.Printf("The closest word to '%s' is '%s'\n", prefix, closest)
}
reader := bufio.NewReader(os.Stdin)
for {
bastion_init.PrintBastionHelp()
fmt.Println()
fmt.Print("enter ==> ")
text, _ := reader.ReadString('\n')
text = strings.TrimSpace(text)
@@ -90,3 +104,8 @@ func BastionModeInit() {
}
}
// uniformInputCommand 归一化输入的命令
func uniformInputCommand(inputString string) {
}