初始化项目

This commit is contained in:
zeaslity
2025-03-27 16:09:20 +08:00
parent e09a32d1e8
commit fc2d585489
709 changed files with 516391 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package utils
import (
"fmt"
"testing"
)
func TestBase64Decode(t *testing.T) {
decode := Base64Decode("blljUk45MXIuX2hq")
fmt.Println(decode)
}
func TestBase64Encode(t *testing.T) {
encode := Base64Encode("RB6Vfzs7XdC2")
fmt.Println(encode)
}
func TestGetRandomString(t *testing.T) {
for i := 0; i < 10; i++ {
randomString := GenerateRandomString(10, true)
fmt.Printf("id: %d randomString: %s\n", i, randomString)
}
}
func TestGetRandomMySQLPassword(t *testing.T) {
rootPassword := GenerateRandomString(12, false)
rootPasswordBase64 := Base64Encode(rootPassword)
k8sAdminPass := GenerateRandomString(12, true)
fmt.Println(rootPassword)
fmt.Println(rootPasswordBase64)
fmt.Println()
fmt.Println(k8sAdminPass)
}