https://github.com/ldmtam/tam-grpc-resolver
https://github.com/ldmtam/tam-grpc-resolver
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ldmtam/tam-grpc-resolver
- Owner: ldmtam
- Created: 2023-08-20T12:56:19.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-20T13:20:21.000Z (over 1 year ago)
- Last Synced: 2025-01-27T23:45:05.933Z (4 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TAM-GRPC-RESOLVER
gRPC name resolver by using kubernetes API that watches namespace and label to resolve new connection in realtime.### Usage
```
import _ "github.com/ldmtam/tam-grpc-resolver" // don't forget to import the resolverconn, err := grpc.DialContext(
context.TODO(),
"tam:///calculator-server.default:8080",
grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil {
log.Fatalf("dial to calculator server failed: %v", err)
}
defer conn.Close()
```An URL should have the following format
```
tam:///{app_name}.{namespace}
tam:///{app_name}.{namespace}:{port}
```Example Project
```
https://github.com/ldmtam/calculator-service
```