add name to server when creating from uid or url
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
af55df1ff5
commit
606c42cd5e
@ -39,6 +39,7 @@ type Server struct {
|
||||
// CreateServerFromUrl creates a server from a basic url, ex : https://my.meowserver.example:8443/meow/
|
||||
func CreateServerFromUrl(url string) *Server {
|
||||
var is Server
|
||||
is.Name = url
|
||||
is.Url = url
|
||||
return &is
|
||||
}
|
||||
@ -47,6 +48,7 @@ func CreateServerFromUrl(url string) *Server {
|
||||
func CreateServerFromUid(uid string) *Server {
|
||||
var is Server
|
||||
uidTable := strings.Split(uid, "@") //! Weak test, use regexp
|
||||
is.Name = uid
|
||||
if len(uidTable) == 2 {
|
||||
loginpw := strings.Split(uidTable[0], ":")
|
||||
is.Url = uidTable[1]
|
||||
|
Loading…
Reference in New Issue
Block a user