class ContextioNext::Client

Attributes

stub[R]

Public Class Methods

new(key:, cert:) click to toggle source
# File lib/contextio_next.rb, line 9
def initialize(key:, cert:)
  @stub = create_stub(key, cert)
end

Private Instance Methods

create_stub(key, cert) click to toggle source
# File lib/contextio_next.rb, line 14
def create_stub(key, cert)
  credentials = GRPC::Core::ChannelCredentials.new(
    File.read(File.dirname(__FILE__) + "/ca.pem"),
    File.read(key),
    File.read(cert)
  )

  CatService::Stub.new("grpc-sandbox.context.io:50051", credentials)
end