wireguard-dashboard/utils/website.go
2024-08-09 11:45:32 +08:00

24 lines
325 B
Go

package utils
import "net/url"
type website struct{}
func WebSite() website {
return website{}
}
// GetHost
// @description: 获取主机host
// @receiver website
// @param addr
// @return string
func (website) GetHost(addr string) string {
uu, err := url.Parse(addr)
if err != nil {
return ""
}
return uu.Host
}