target.go 437 B

1234567891011121314151617
  1. package internal
  2. import (
  3. "fmt"
  4. "strings"
  5. "github.com/tal-tech/go-zero/rpcx/internal/resolver"
  6. )
  7. func BuildDirectTarget(endpoints []string) string {
  8. return fmt.Sprintf("%s:///%s", resolver.DirectScheme, strings.Join(endpoints, resolver.EndpointSep))
  9. }
  10. func BuildDiscovTarget(endpoints []string, key string) string {
  11. return fmt.Sprintf("%s://%s/%s", resolver.DiscovScheme,
  12. strings.Join(endpoints, resolver.EndpointSep), key)
  13. }