fix: remove deprecated dependencies (#1837)
* fix: remove deprecated dependencies * backup * fix test error
This commit is contained in:
19
zrpc/resolver/internal/targets/endpoints.go
Normal file
19
zrpc/resolver/internal/targets/endpoints.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package targets
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"google.golang.org/grpc/resolver"
|
||||
)
|
||||
|
||||
const slashSeparator = "/"
|
||||
|
||||
// GetAuthority returns the authority of the target.
|
||||
func GetAuthority(target resolver.Target) string {
|
||||
return target.URL.Host
|
||||
}
|
||||
|
||||
// GetEndpoints returns the endpoints from the given target.
|
||||
func GetEndpoints(target resolver.Target) string {
|
||||
return strings.Trim(target.URL.Path, slashSeparator)
|
||||
}
|
||||
Reference in New Issue
Block a user