2024-02-21 14:58:51 +00:00
|
|
|
package grpc
|
|
|
|
|
|
|
|
import (
|
2024-03-26 14:49:12 +00:00
|
|
|
idpb "git.solsynth.dev/hydrogen/identity/pkg/grpc/proto"
|
2024-02-21 14:58:51 +00:00
|
|
|
"google.golang.org/grpc/credentials/insecure"
|
|
|
|
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
)
|
|
|
|
|
2024-03-26 14:49:12 +00:00
|
|
|
var Notify idpb.NotifyClient
|
|
|
|
var Auth idpb.AuthClient
|
2024-02-21 14:58:51 +00:00
|
|
|
|
|
|
|
func ConnectPassport() error {
|
|
|
|
addr := viper.GetString("identity.grpc_endpoint")
|
|
|
|
if conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials())); err != nil {
|
|
|
|
return err
|
|
|
|
} else {
|
2024-03-26 14:49:12 +00:00
|
|
|
Notify = idpb.NewNotifyClient(conn)
|
|
|
|
Auth = idpb.NewAuthClient(conn)
|
2024-02-21 14:58:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|