feat: support third party orm to interact with go-zero (#1286)
* fixes #987 * chore: fix test failure * chore: add comments * feat: support third party orm to interact with go-zero * chore: refactormaster v1.2.4
parent
543d590710
commit
9d528dddd6
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
import (
|
||||
"strings"
|
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
import (
|
||||
"strings"
|
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
import (
|
||||
"testing"
|
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
type etcdBuilder struct {
|
||||
discovBuilder
|
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
import (
|
||||
"testing"
|
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
import (
|
||||
"testing"
|
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
import "math/rand"
|
||||
|
@ -1,4 +1,4 @@
|
||||
package resolver
|
||||
package internal
|
||||
|
||||
import (
|
||||
"strconv"
|
@ -0,0 +1,11 @@
|
||||
package resolver
|
||||
|
||||
import (
|
||||
"github.com/tal-tech/go-zero/zrpc/resolver/internal"
|
||||
)
|
||||
|
||||
// Register registers schemes defined zrpc.
|
||||
// Keep it in a separated package to let third party register manually.
|
||||
func Register() {
|
||||
internal.RegisterResolver()
|
||||
}
|
@ -1,20 +1,20 @@
|
||||
package internal
|
||||
package resolver
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/tal-tech/go-zero/zrpc/internal/resolver"
|
||||
"github.com/tal-tech/go-zero/zrpc/resolver/internal"
|
||||
)
|
||||
|
||||
// BuildDirectTarget returns a string that represents the given endpoints with direct schema.
|
||||
func BuildDirectTarget(endpoints []string) string {
|
||||
return fmt.Sprintf("%s:///%s", resolver.DirectScheme,
|
||||
strings.Join(endpoints, resolver.EndpointSep))
|
||||
return fmt.Sprintf("%s:///%s", internal.DirectScheme,
|
||||
strings.Join(endpoints, internal.EndpointSep))
|
||||
}
|
||||
|
||||
// BuildDiscovTarget returns a string that represents the given endpoints with discov schema.
|
||||
func BuildDiscovTarget(endpoints []string, key string) string {
|
||||
return fmt.Sprintf("%s://%s/%s", resolver.DiscovScheme,
|
||||
strings.Join(endpoints, resolver.EndpointSep), key)
|
||||
return fmt.Sprintf("%s://%s/%s", internal.DiscovScheme,
|
||||
strings.Join(endpoints, internal.EndpointSep), key)
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package internal
|
||||
package resolver
|
||||
|
||||
import (
|
||||
"testing"
|
Loading…
Reference in New Issue