// Split an URL into three parts: protocol host and port
Split an URL into three parts: protocol host and port
// Split an URL into three parts : protocol host and port
func qsParseEndpoint(endpoint string) (protocol, host, port string, err error) {
	defer func() {
		if r := recover(); r != nil {
			switch x := r.(type) {
			case error:
				err = x
			default:
				err = nil
			}
		}
	}()
	var mather = regexp.MustCompile(`^(?:(http|https)://)*(\w+\.(?:[\w\.])*)(?::(\d{0,5}))*$`)
	parts := mather.FindStringSubmatch(endpoint)
	protocol, host, port = parts[1], parts[2], parts[3]
	return
}
func qsParseEndpoint ( endpoint string ) ( protocol , host , port string , err error ) { defer func ( ) { if r := recover ( ) ; r != nil { switch x := r . ( type ) { case error : err = x default : err = nil } } } ( ) var mather = regexp . MustCompile ( `^(?:(http|https)://)*(\w+\.(?:[\w\.])*)(?::(\d{0,5}))*$` ) parts := mather . FindStringSubmatch ( endpoint ) protocol , host , port = parts [ 1 ] , parts [ 2 ] , parts [ 3 ] return }
Split an URL into three parts: protocol host and port
Split an URL into three parts : protocol host and port
/*
	  Pattern to match a endpoint,
	  eg: "http(s)://qingstor.com:443" --> "http(s)", "qingstor.com", 443
	      "http(s)//qingstor.com"      --> "http(s)", "qingstor.com", ""
	      "qingstor.com"               --> "", "qingstor.com", ""
	*/