mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-08 21:47:17 +08:00
fix bug:Implement option interface
This commit is contained in:
parent
60763a8417
commit
84032a536d
@ -209,15 +209,15 @@ config:
|
||||
###################### RPC Register Name Configuration ######################
|
||||
# RPC service names for registration, it's not recommended to modify these
|
||||
rpcRegisterName:
|
||||
openImUserName: openimserver-openim-rpc-user
|
||||
openImFriendName: openimserver-openim-rpc-friend
|
||||
openImMsgName: openimserver-openim-rpc-msg
|
||||
openImPushName: openimserver-openim-push
|
||||
openImUserName: openimserver-openim-rpc-user:80
|
||||
openImFriendName: openimserver-openim-rpc-friend:80
|
||||
openImMsgName: openimserver-openim-rpc-msg:80
|
||||
openImPushName: openimserver-openim-push:80
|
||||
openImMessageGatewayName: openimserver-openim-msggateway:88
|
||||
openImGroupName: openimserver-openim-rpc-group
|
||||
openImAuthName: openimserver-openim-rpc-auth
|
||||
openImConversationName: openimserver-openim-rpc-conversation
|
||||
openImThirdName: openimserver-openim-rpc-third
|
||||
openImGroupName: openimserver-openim-rpc-group:80
|
||||
openImAuthName: openimserver-openim-rpc-auth:80
|
||||
openImConversationName: openimserver-openim-rpc-conversation:80
|
||||
openImThirdName: openimserver-openim-rpc-third:80
|
||||
|
||||
###################### Log Configuration ######################
|
||||
# Log configuration
|
||||
|
||||
@ -34,6 +34,7 @@ func NewDiscoveryRegister(envType string) (discoveryregistry.SvcDiscoveryRegistr
|
||||
}
|
||||
|
||||
type K8sDR struct {
|
||||
options []grpc.DialOption
|
||||
rpcRegisterAddr string
|
||||
}
|
||||
|
||||
@ -65,19 +66,19 @@ func (cli *K8sDR) GetConfFromRegistry(key string) ([]byte, error) {
|
||||
}
|
||||
func (cli *K8sDR) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error) {
|
||||
|
||||
conn, err := grpc.DialContext(ctx, serviceName, grpc.WithInsecure())
|
||||
conn, err := grpc.DialContext(ctx, serviceName, append(cli.options, opts...)...)
|
||||
return []*grpc.ClientConn{conn}, err
|
||||
}
|
||||
func (cli *K8sDR) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error) {
|
||||
|
||||
return grpc.DialContext(ctx, serviceName, grpc.WithInsecure())
|
||||
return grpc.DialContext(ctx, serviceName, append(cli.options, opts...)...)
|
||||
}
|
||||
func (cli *K8sDR) GetSelfConnTarget() string {
|
||||
|
||||
return cli.rpcRegisterAddr
|
||||
}
|
||||
func (cli *K8sDR) AddOption(opts ...grpc.DialOption) {
|
||||
|
||||
cli.options = append(cli.options, opts...)
|
||||
}
|
||||
func (cli *K8sDR) CloseConn(conn *grpc.ClientConn) {
|
||||
conn.Close()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user