Sha256: b93c846424d9ae71f7c8bda7e11dfb112a236f93fb28f9ae44e34b93ed2bb0b2
Contents?: true
Size: 1.01 KB
Versions: 2
Compression:
Stored size: 1.01 KB
Contents
module Dryad module Consul class ServiceRegistry class << self def register(service) service.to_registers.each do |register| ServiceClient.register(register) end end def deregister(service) service.portals.each do |portal| ServiceClient.deregister(portal.id) end end def service_instances(name, schema, groups) all_services = ServiceClient.get(Dryad::Core::Service.full_name(schema, name), :all) services = [] all_services.each do |service| groups.each do |group| services << service if service.ServiceTags.include?("group = \"#{group}\"") end end services.map do |service| Dryad::Core::ServiceInstance.new( name: name, schema: schema, address: service.ServiceAddress, port: service.ServicePort ) end end end end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
dryad-0.1.0 | dryad-consul/lib/dryad/consul/service_registry.rb |
dryad-consul-0.1.0 | lib/dryad/consul/service_registry.rb |