pkg update
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package grpcimp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -59,23 +58,7 @@ func (c *Config) DiscoveryInvokeURI() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s://%s:%s", c.discoveryScheme(), host, addrPort)
|
||||
}
|
||||
|
||||
func (c *Config) discoveryScheme() string {
|
||||
scheme := strings.TrimSpace(c.AdvertiseScheme)
|
||||
if envKey := strings.TrimSpace(c.AdvertiseSchemeEnv); envKey != "" {
|
||||
if value := strings.TrimSpace(os.Getenv(envKey)); value != "" {
|
||||
scheme = value
|
||||
}
|
||||
}
|
||||
if scheme != "" {
|
||||
return scheme
|
||||
}
|
||||
if c != nil && c.TLS != nil && strings.TrimSpace(c.TLS.CertFile) != "" && strings.TrimSpace(c.TLS.KeyFile) != "" {
|
||||
return "grpcs"
|
||||
}
|
||||
return "grpc"
|
||||
return net.JoinHostPort(host, addrPort)
|
||||
}
|
||||
|
||||
func splitHostPort(address string) (string, string) {
|
||||
|
||||
Reference in New Issue
Block a user