This commit is contained in:
parent
6867086c4f
commit
53145f1c5e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user