Skip to content

Commit

Permalink
client: export GetLeaderAddr (#1996) (#2001)
Browse files Browse the repository at this point in the history
Signed-off-by: disksing <i@disksing.com>
  • Loading branch information
sre-bot authored Dec 10, 2019
1 parent e98dda0 commit 19b6ccf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import (
type Client interface {
// GetClusterID gets the cluster ID from PD.
GetClusterID(ctx context.Context) uint64
// GetLeaderAddr returns current leader's address. It returns "" before
// syncing leader from server.
GetLeaderAddr() string
// GetTS gets a timestamp from PD.
GetTS(ctx context.Context) (int64, int64, error)
// GetTSAsync gets a timestamp from PD, without block the caller.
Expand Down Expand Up @@ -522,7 +525,6 @@ func (c *client) GetClusterID(context.Context) uint64 {
return c.clusterID
}

// For testing use.
func (c *client) GetLeaderAddr() string {
c.connMu.RLock()
defer c.connMu.RUnlock()
Expand Down

0 comments on commit 19b6ccf

Please sign in to comment.