[Agent][Bastion] - Bastion mode - 2

This commit is contained in:
zeaslity
2024-04-17 16:42:02 +08:00
parent c0712b7325
commit dacdb6588e
12 changed files with 383 additions and 203 deletions

View File

@@ -1,27 +1,5 @@
package bastion_init
import (
"fmt"
"io"
"os"
)
// getStandardOutPutLength 获取到标准输出终端的长度
func getStandardOutPutLength() (int, error) {
buffer := make([]byte, 0)
_, err := io.ReadFull(os.Stdout, buffer)
if err != nil {
return 0, err
}
return len(buffer), nil
}
func PrintBastionHelp() {
length, err := getStandardOutPutLength()
if err == nil {
fmt.Printf("标准输出终端的长度: %d 字节\n", length)
} else {
fmt.Println("获取标准输出终端长度时发生错误:", err)
}
}