Remove Port from registry
This commit is contained in:
		
							
								
								
									
										6
									
								
								grpc.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								grpc.go
									
									
									
									
									
								
							| @@ -84,9 +84,6 @@ func (g *grpcClient) next(request client.Request, opts client.CallOptions) (sele | ||||
|  | ||||
| func (g *grpcClient) call(ctx context.Context, node *registry.Node, req client.Request, rsp interface{}, opts client.CallOptions) error { | ||||
| 	address := node.Address | ||||
| 	if node.Port > 0 { | ||||
| 		address = fmt.Sprintf("%s:%d", address, node.Port) | ||||
| 	} | ||||
|  | ||||
| 	header := make(map[string]string) | ||||
| 	if md, ok := metadata.FromContext(ctx); ok { | ||||
| @@ -146,9 +143,6 @@ func (g *grpcClient) call(ctx context.Context, node *registry.Node, req client.R | ||||
|  | ||||
| func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client.Request, opts client.CallOptions) (client.Stream, error) { | ||||
| 	address := node.Address | ||||
| 	if node.Port > 0 { | ||||
| 		address = fmt.Sprintf("%s:%d", address, node.Port) | ||||
| 	} | ||||
|  | ||||
| 	header := make(map[string]string) | ||||
| 	if md, ok := metadata.FromContext(ctx); ok { | ||||
|   | ||||
| @@ -2,6 +2,7 @@ package grpc | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"fmt" | ||||
| 	"net" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
| @@ -50,8 +51,7 @@ func TestGRPCClient(t *testing.T) { | ||||
| 		Nodes: []*registry.Node{ | ||||
| 			®istry.Node{ | ||||
| 				Id:      "test-1", | ||||
| 				Address: addr, | ||||
| 				Port:    port, | ||||
| 				Address: fmt.Sprintf("%s:%d", addr, port), | ||||
| 			}, | ||||
| 		}, | ||||
| 	}) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user