createInternodeGRPCConnection creates connection for gRPC calls
(hostName string, serviceName primitives.ServiceName)
| 268 | |
| 269 | // createInternodeGRPCConnection creates connection for gRPC calls |
| 270 | func (d *RPCFactory) createInternodeGRPCConnection(hostName string, serviceName primitives.ServiceName) *grpc.ClientConn { |
| 271 | var tlsClientConfig *tls.Config |
| 272 | var err error |
| 273 | if d.tlsFactory != nil { |
| 274 | tlsClientConfig, err = d.tlsFactory.GetInternodeClientConfig() |
| 275 | if err != nil { |
| 276 | d.logger.Fatal("Failed to create tls config for gRPC connection", tag.Error(err)) |
| 277 | return nil |
| 278 | } |
| 279 | } |
| 280 | additionalDialOptions := append([]grpc.DialOption{}, d.perServiceDialOptions[serviceName]...) |
| 281 | return d.dial(hostName, tlsClientConfig, append(additionalDialOptions, d.getClientKeepAliveConfig(serviceName))...) |
| 282 | } |
| 283 | |
| 284 | func (d *RPCFactory) CreateHistoryGRPCConnection(rpcAddress string) *grpc.ClientConn { |
| 285 | return d.createInternodeGRPCConnection(rpcAddress, primitives.HistoryService) |
no test coverage detected