go-zero/rpcx/internal/target.go

19 lines
465 B
Go
Raw Normal View History

2020-08-18 18:36:44 +08:00
package internal
import (
"fmt"
"strings"
"github.com/tal-tech/go-zero/rpcx/internal/resolver"
)
func BuildDirectTarget(endpoints []string) string {
2020-08-20 15:35:13 +08:00
return fmt.Sprintf("%s:///%s", resolver.DirectScheme, strings.Join(
endpoints, fmt.Sprint(resolver.EndpointSep)))
2020-08-18 18:36:44 +08:00
}
func BuildDiscovTarget(endpoints []string, key string) string {
2020-08-20 15:35:13 +08:00
return fmt.Sprintf("%s://%s/%s", resolver.DiscovScheme, strings.Join(
endpoints, fmt.Sprint(resolver.EndpointSep)), key)
2020-08-18 18:36:44 +08:00
}