Selaa lähdekoodia

clientv3: support unixs:// scheme

For using TLS without giving a TLSConfig to the client.
Anthony Romano 8 vuotta sitten
vanhempi
commit
b4c655677a
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      clientv3/client.go

+ 2 - 2
clientv3/client.go

@@ -182,7 +182,7 @@ func parseEndpoint(endpoint string) (proto string, host string, scheme string) {
 	host = url.Host
 	host = url.Host
 	switch url.Scheme {
 	switch url.Scheme {
 	case "http", "https":
 	case "http", "https":
-	case "unix":
+	case "unix", "unixs":
 		proto = "unix"
 		proto = "unix"
 		host = url.Host + url.Path
 		host = url.Host + url.Path
 	default:
 	default:
@@ -197,7 +197,7 @@ func (c *Client) processCreds(scheme string) (creds *credentials.TransportCreden
 	case "unix":
 	case "unix":
 	case "http":
 	case "http":
 		creds = nil
 		creds = nil
-	case "https":
+	case "https", "unixs":
 		if creds != nil {
 		if creds != nil {
 			break
 			break
 		}
 		}