Module: Kumonos::Envoy::AddressParser

Defined in:
lib/kumonos/envoy.rb

Overview

Parse old address string

Class Method Summary collapse

Class Method Details

.call(address) ⇒ Object



232
233
234
235
236
237
238
239
240
241
# File 'lib/kumonos/envoy.rb', line 232

def self.call(address)
  raise "invalid address given: #{address}" if address !~ %r{tcp://([^:]+):(\d+)}

  {
    socket_address: {
      address: Regexp.last_match(1),
      port_value: Integer(Regexp.last_match(2))
    }
  }
end