From 49a352c6540ff77a2dd2c704d6a613be60ea52e0 Mon Sep 17 00:00:00 2001 From: cheliequan <liequanche@126.com> Date: 星期三, 24 五月 2023 18:10:48 +0800 Subject: [PATCH] 重构项目,导出函数手写字母大写 --- src/util/util.go | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/util.go b/src/util/util.go index 3da9a85..08caedd 100644 --- a/src/util/util.go +++ b/src/util/util.go @@ -12,14 +12,14 @@ ) // homeDir 鑾峰彇褰撳墠鐢ㄦ埛鐨勫鐩綍璺緞 -func homeDir() string { +func HomeDir() string { if h := os.Getenv("HOME"); h != "" { return h } return os.Getenv("USERPROFILE") // Windows 鐜涓嬭幏鍙栫敤鎴风洰褰� } -func sshExec(nodeIP, sshUsername, sshPassword, remoteSSHCommand string, sshPort int) (string, error) { +func SSHExec(nodeIP, sshUsername, sshPassword, remoteSSHCommand string, sshPort int) (string, error) { // SSH 杩炴帴閰嶇疆 config := &ssh.ClientConfig{ User: sshUsername, @@ -97,7 +97,7 @@ } // 瀹夎Docker -func installDocker(nodeIP, sshUsername, sshPassword string, sshPort int) error { +func InstallDocker(nodeIP, sshUsername, sshPassword string, sshPort int) error { // 妫�鏌ocker鏄惁宸插畨瑁� checkCommand := "which docker" _, err := sshExec(nodeIP, sshUsername, sshPassword, checkCommand, sshPort) @@ -118,7 +118,7 @@ } // Create an HTTP client with insecure TLS configuration -func createHTTPClient() *http.Client { +func CreateHTTPClient() *http.Client { transport := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } @@ -126,7 +126,7 @@ } // 瀹夎kubectl -func installKubectl(nodeIP, sshUsername, sshPassword string, sshPort int) error { +func InstallKubectl(nodeIP, sshUsername, sshPassword string, sshPort int) error { // 妫�鏌ubectl鏄惁宸插畨瑁� checkCommand := "which kubectl" _, err := sshExec(nodeIP, sshUsername, sshPassword, checkCommand, sshPort) -- Gitblit v1.8.0