func NewClient(addr string, timeout time.Duration) (*Client, error) {
	u, err := url.Parse(addr)
	if err != nil {
		return nil, errors.Trace(err)
	}
	u.Path = apiPrefix

	scheme := u.Scheme
	if u.Scheme == "unix" || u.Scheme == "unixs" {
		u.Scheme = "http"
	}

	client := &Client{
		hc:  NewHTTPClient(scheme, timeout),
		url: u.String(),
	}
	return client, nil
}
// NewClient returns a client to access PD APIs.
NewClient returns a client to access PD APIs.
// NewClient returns a client to access PD APIs .
func NewClient(addr string, timeout time.Duration) (*Client, error) {
	u, err := url.Parse(addr)
	if err != nil {
		return nil, errors.Trace(err)
	}
	u.Path = apiPrefix
	scheme := u.Scheme
	if u.Scheme == "unix" || u.Scheme == "unixs" {
		u.Scheme = "http"
	}
	client := &Client{
		hc:  NewHTTPClient(scheme, timeout),
		url: u.String(),
	}
	return client, nil
}
func NewClient ( addr string , timeout time . Duration ) ( * Client , error ) { u , err := url . Parse ( addr ) if err != nil { return nil , errors . Trace ( err ) } u . Path = apiPrefix scheme := u . Scheme if u . Scheme == " " || u . Scheme == " " { u . Scheme = " " } client := & Client { hc : NewHTTPClient ( scheme , timeout ) , url : u . String ( ) , } return client , nil }
NewClient returns a client to access PD APIs.
NewClient returns a client to access PD APIs .