func (c *Client) GetLeader() (*pdpb.Leader, error) {
	leaderURL := c.url + "/leader"
	resp, err := c.hc.Get(leaderURL)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if resp.StatusCode != http.StatusOK {
		return nil, errors.Errorf("GET %s: %s", leaderURL, resp.Status)
	}
	leader := &pdpb.Leader{}
	if err := ReadJSON(resp.Body, leader); err != nil {
		return nil, errors.Trace(err)
	}
	return leader, nil
}
// GetLeader returns the PD leader info.
GetLeader returns the PD leader info.
// GetLeader returns the PD leader info .
func (c *Client) GetLeader() (*pdpb.Leader, error) {
	leaderURL := c.url + "/leader"
	resp, err := c.hc.Get(leaderURL)
	if err != nil {
		return nil, errors.Trace(err)
	}
	if resp.StatusCode != http.StatusOK {
		return nil, errors.Errorf("GET %s: %s", leaderURL, resp.Status)
	}
	leader := &pdpb.Leader{}
	if err := ReadJSON(resp.Body, leader); err != nil {
		return nil, errors.Trace(err)
	}
	return leader, nil
}
func ( c * Client ) GetLeader ( ) ( * pdpb . Leader , error ) { leaderURL := c . url + " " resp , err := c . hc . Get ( leaderURL ) if err != nil { return nil , errors . Trace ( err ) } if resp . StatusCode != http . StatusOK { return nil , errors . Errorf ( " " , leaderURL , resp . Status ) } leader := & pdpb . Leader { } if err := ReadJSON ( resp . Body , leader ) ; err != nil { return nil , errors . Trace ( err ) } return leader , nil }
GetLeader returns the PD leader info.
GetLeader returns the PD leader info .