Class: EventStoreClient::GRPC::Connection
- Inherits:
-
Object
- Object
- EventStoreClient::GRPC::Connection
- Includes:
- Configuration
- Defined in:
- lib/event_store_client/adapters/grpc/connection.rb
Instance Method Summary collapse
-
#call(stub_klass, options: {}) ⇒ Stub
Initializes the proper stub with the necessary credentials to create working gRPC connection - Refer to generated grpc files.
Methods included from Configuration
Instance Method Details
#call(stub_klass, options: {}) ⇒ Stub
Initializes the proper stub with the necessary credentials to create working gRPC connection - Refer to generated grpc files
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/event_store_client/adapters/grpc/connection.rb', line 16 def call(stub_klass, options: {}) credentials = [:credentials] || Base64.encode64("#{config.eventstore_user}:#{config.eventstore_password}") stub_klass.new( "#{config.eventstore_url.host}:#{config.eventstore_url.port}", channel_credentials, channel_args: { 'authorization' => "Basic #{credentials.delete("\n")}" } ) end |