CLI Deploy

This commit is contained in:
2023-12-10 14:52:00 +08:00
parent c10dfd4c73
commit 5e59bfe912
11 changed files with 223 additions and 18 deletions

View File

@@ -0,0 +1,17 @@
package conn
import (
"encoding/json"
"github.com/samber/lo"
"github.com/spf13/viper"
)
func GetConnection(id string) (CliConnection, bool) {
var servers []CliConnection
raw, _ := json.Marshal(viper.Get("servers"))
_ = json.Unmarshal(raw, &servers)
return lo.Find(servers, func(item CliConnection) bool {
return item.ID == id
})
}