[agent] - bastion mode init
This commit is contained in:
@@ -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) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user