Browse Source

Add private method to Client interface to prevent implementation

Justin Chen 4 years ago
parent
commit
47ad801aa8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      client.go

+ 5 - 0
client.go

@@ -93,6 +93,9 @@ type Client interface {
 
 	// Closed returns true if the client has already had Close called on it
 	Closed() bool
+
+	// A private method to prevent users implementing the interface for compatibility
+	private()
 }
 
 const (
@@ -187,6 +190,8 @@ func NewClient(addrs []string, conf *Config) (Client, error) {
 	return client, nil
 }
 
+func (client *client) private() {}
+
 func (client *client) Config() *Config {
 	return client.conf
 }