diff --git a/client/server.go b/client/server.go index bee5d5d..8aa46dc 100644 --- a/client/server.go +++ b/client/server.go @@ -2,6 +2,7 @@ package client import ( "fmt" + "strings" "time" "forge.redroom.link/yves/meowlib" @@ -41,6 +42,17 @@ func CreateServerFromUrl(url string) *Server { return &is } +// CreateServerFromUid creates a server from a uid string, ex : mylogin:mypassword@https://my.meowserver.example:8443/meow/ +func CreateServerFromUid(uid string) *Server { + var is Server + uidTable := strings.Split(uid, "@") + loginpw := strings.Split(uidTable[0], ":") + is.Url = uidTable[1] + is.Login = loginpw[0] + is.Password = loginpw[1] + return &is +} + // GetServerCard returns a server card from a server func (ints *Server) GetServerCard() *meowlib.ServerCard { var sc meowlib.ServerCard