@@ -55,14 +55,17 @@ func (cli *K8sDR) Register(serviceName, host string, port int, opts ...grpc.Dial
55
55
56
56
return nil
57
57
}
58
+
58
59
func (cli * K8sDR ) UnRegister () error {
59
60
60
61
return nil
61
62
}
63
+
62
64
func (cli * K8sDR ) CreateRpcRootNodes (serviceNames []string ) error {
63
65
64
66
return nil
65
67
}
68
+
66
69
func (cli * K8sDR ) RegisterConf2Registry (key string , conf []byte ) error {
67
70
68
71
return nil
@@ -123,6 +126,8 @@ func getMsgGatewayHost(ctx context.Context) []string {
123
126
log .ZInfo (ctx , "getMsgGatewayHost" , "instance" , instance , "selfPodName" , selfPodName , "replicas" , replicas , "ns" , ns , "ret" , ret )
124
127
return ret
125
128
}
129
+
130
+ // GetConns returns the gRPC client connections to the specified service.
126
131
func (cli * K8sDR ) GetConns (ctx context.Context , serviceName string , opts ... grpc.DialOption ) ([]* grpc.ClientConn , error ) {
127
132
128
133
if serviceName != config .Config .RpcRegisterName .OpenImMessageGatewayName {
@@ -142,6 +147,7 @@ func (cli *K8sDR) GetConns(ctx context.Context, serviceName string, opts ...grpc
142
147
return ret , nil
143
148
}
144
149
}
150
+
145
151
func (cli * K8sDR ) GetConn (ctx context.Context , serviceName string , opts ... grpc.DialOption ) (* grpc.ClientConn , error ) {
146
152
147
153
return grpc .DialContext (ctx , serviceName , append (cli .options , opts ... )... )
@@ -151,9 +157,11 @@ func (cli *K8sDR) GetSelfConnTarget() string {
151
157
152
158
return cli .rpcRegisterAddr
153
159
}
160
+
154
161
func (cli * K8sDR ) AddOption (opts ... grpc.DialOption ) {
155
162
cli .options = append (cli .options , opts ... )
156
163
}
164
+
157
165
func (cli * K8sDR ) CloseConn (conn * grpc.ClientConn ) {
158
166
conn .Close ()
159
167
}
0 commit comments