Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SCB-1404]Rename GPRCDefaultDestinationResolver to GRPCDefaultDestinationResolver. #57

Merged
merged 1 commit into from Aug 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions proxy/resolver/authority/destination.go
Expand Up @@ -24,12 +24,12 @@ import (
"strings"
)

//GPRCDefaultDestinationResolver is a struct
type GPRCDefaultDestinationResolver struct {
//GRPCDefaultDestinationResolver is a struct
type GRPCDefaultDestinationResolver struct {
}

//Resolve resolves service name
func (dr *GPRCDefaultDestinationResolver) Resolve(sourceAddr string, header map[string]string, rawURI string, destinationName *string) (string, error) {
func (dr *GRPCDefaultDestinationResolver) Resolve(sourceAddr string, header map[string]string, rawURI string, destinationName *string) (string, error) {
s := strings.Split(rawURI, ":")
if len(s) != 2 {
err := fmt.Errorf("can not parse [%s]", rawURI)
Expand All @@ -43,10 +43,10 @@ func (dr *GPRCDefaultDestinationResolver) Resolve(sourceAddr string, header map[

//New return return dr
func New() resolver.DestinationResolver {
return &GPRCDefaultDestinationResolver{}
return &GRPCDefaultDestinationResolver{}
}

func init() {
resolver.InstallDestinationResolverPlugin("authority", New)
resolver.SetDefaultDestinationResolver("grpc", &GPRCDefaultDestinationResolver{})
resolver.SetDefaultDestinationResolver("grpc", &GRPCDefaultDestinationResolver{})
}
4 changes: 2 additions & 2 deletions proxy/resolver/authority/destination_test.go
Expand Up @@ -30,7 +30,7 @@ import (
func TestResolve(t *testing.T) {
lager.Initialize("", "DEBUG", "",
"size", true, 1, 10, 7)
d := &authority.GPRCDefaultDestinationResolver{}
d := &authority.GRPCDefaultDestinationResolver{}
header := http.Header{}
header.Add("cookie", "user=jason")
header.Add("X-Age", "18")
Expand Down Expand Up @@ -59,7 +59,7 @@ func TestResolve(t *testing.T) {
func BenchmarkDefaultDestinationResolver_Resolve(b *testing.B) {
lager.Initialize("", "DEBUG", "",
"size", true, 1, 10, 7)
d := &authority.GPRCDefaultDestinationResolver{}
d := &authority.GRPCDefaultDestinationResolver{}
mystring := "Server"
var destinationString = &mystring
for i := 0; i < b.N; i++ {
Expand Down