⬆️ Upgrade Passport and use Hyper SDK
This commit is contained in:
12
pkg/internal/gap/client.go
Normal file
12
pkg/internal/gap/client.go
Normal file
@ -0,0 +1,12 @@
|
||||
package gap
|
||||
|
||||
import (
|
||||
"git.solsynth.dev/hydrogen/passport/pkg/hyper"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var H *hyper.HyperConn
|
||||
|
||||
func NewHyperClient() {
|
||||
H = hyper.NewHyperConn(viper.GetString("consul.addr"))
|
||||
}
|
@ -7,8 +7,6 @@ import (
|
||||
|
||||
"github.com/hashicorp/consul/api"
|
||||
"github.com/spf13/viper"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
func Register() error {
|
||||
@ -40,12 +38,3 @@ func Register() error {
|
||||
|
||||
return client.Agent().ServiceRegister(registration)
|
||||
}
|
||||
|
||||
func DiscoverPassport() (*grpc.ClientConn, error) {
|
||||
target := fmt.Sprintf("consul://%s/Hydrogen.Passport", viper.GetString("consul.addr"))
|
||||
return grpc.NewClient(
|
||||
target,
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy": "round_robin"}`),
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user