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 (
|
import (
|
||||||
"strings"
|
"strings"
|
@ -1,4 +1,4 @@
|
|||||||
package resolver
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,4 +1,4 @@
|
|||||||
package resolver
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
@ -1,4 +1,4 @@
|
|||||||
package resolver
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
@ -1,4 +1,4 @@
|
|||||||
package resolver
|
package internal
|
||||||
|
|
||||||
type etcdBuilder struct {
|
type etcdBuilder struct {
|
||||||
discovBuilder
|
discovBuilder
|
@ -1,4 +1,4 @@
|
|||||||
package resolver
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
@ -1,4 +1,4 @@
|
|||||||
package resolver
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,4 +1,4 @@
|
|||||||
package resolver
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
@ -1,4 +1,4 @@
|
|||||||
package resolver
|
package internal
|
||||||
|
|
||||||
import "math/rand"
|
import "math/rand"
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package resolver
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
"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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"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.
|
// BuildDirectTarget returns a string that represents the given endpoints with direct schema.
|
||||||
func BuildDirectTarget(endpoints []string) string {
|
func BuildDirectTarget(endpoints []string) string {
|
||||||
return fmt.Sprintf("%s:///%s", resolver.DirectScheme,
|
return fmt.Sprintf("%s:///%s", internal.DirectScheme,
|
||||||
strings.Join(endpoints, resolver.EndpointSep))
|
strings.Join(endpoints, internal.EndpointSep))
|
||||||
}
|
}
|
||||||
|
|
||||||
// BuildDiscovTarget returns a string that represents the given endpoints with discov schema.
|
// BuildDiscovTarget returns a string that represents the given endpoints with discov schema.
|
||||||
func BuildDiscovTarget(endpoints []string, key string) string {
|
func BuildDiscovTarget(endpoints []string, key string) string {
|
||||||
return fmt.Sprintf("%s://%s/%s", resolver.DiscovScheme,
|
return fmt.Sprintf("%s://%s/%s", internal.DiscovScheme,
|
||||||
strings.Join(endpoints, resolver.EndpointSep), key)
|
strings.Join(endpoints, internal.EndpointSep), key)
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package internal
|
package resolver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
Loading…
Reference in New Issue