-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: refactor
- Loading branch information
Showing
24 changed files
with
55 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/directbuilder.go → zrpc/resolver/internal/directbuilder.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
import ( | ||
"strings" | ||
|
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/directbuilder_test.go → zrpc/resolver/internal/directbuilder_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
import ( | ||
"fmt" | ||
|
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/discovbuilder.go → zrpc/resolver/internal/discovbuilder.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
import ( | ||
"strings" | ||
|
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/discovbuilder_test.go → zrpc/resolver/internal/discovbuilder_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
import ( | ||
"testing" | ||
|
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/etcdbuilder.go → zrpc/resolver/internal/etcdbuilder.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
type etcdBuilder struct { | ||
discovBuilder | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/kubebuilder_test.go → zrpc/resolver/internal/kubebuilder_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
import ( | ||
"testing" | ||
|
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/resolver.go → zrpc/resolver/internal/resolver.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
import ( | ||
"fmt" | ||
|
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/resolver_test.go → zrpc/resolver/internal/resolver_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
import ( | ||
"testing" | ||
|
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/subset.go → zrpc/resolver/internal/subset.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
import "math/rand" | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
zrpc/internal/resolver/subset_test.go → zrpc/resolver/internal/subset_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resolver | ||
package internal | ||
|
||
import ( | ||
"strconv" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package internal | ||
package resolver | ||
|
||
import ( | ||
"testing" | ||
|