dryad 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -10
- data/dryad.gemspec +2 -0
- data/lib/dryad/version.rb +1 -1
- metadata +8 -81
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.travis.yml +0 -19
- data/dryad-cluster/.gitignore +0 -11
- data/dryad-cluster/.rspec +0 -3
- data/dryad-cluster/Gemfile +0 -4
- data/dryad-cluster/Gemfile.lock +0 -50
- data/dryad-cluster/LICENSE +0 -19
- data/dryad-cluster/README.md +0 -35
- data/dryad-cluster/Rakefile +0 -6
- data/dryad-cluster/bin/console +0 -14
- data/dryad-cluster/bin/setup +0 -8
- data/dryad-cluster/dryad-cluster.gemspec +0 -31
- data/dryad-cluster/lib/dryad/cluster.rb +0 -40
- data/dryad-cluster/lib/dryad/cluster/railtie.rb +0 -15
- data/dryad-cluster/lib/dryad/cluster/round_robin.rb +0 -22
- data/dryad-cluster/lib/dryad/cluster/version.rb +0 -5
- data/dryad-cluster/spec/dryad/cluster/round_robin_spec.rb +0 -21
- data/dryad-cluster/spec/dryad/cluster_spec.rb +0 -42
- data/dryad-cluster/spec/spec_helper.rb +0 -16
- data/dryad-consul/.gitignore +0 -11
- data/dryad-consul/.rspec +0 -3
- data/dryad-consul/Gemfile +0 -4
- data/dryad-consul/Gemfile.lock +0 -45
- data/dryad-consul/LICENSE +0 -19
- data/dryad-consul/README.md +0 -35
- data/dryad-consul/Rakefile +0 -6
- data/dryad-consul/bin/console +0 -14
- data/dryad-consul/bin/setup +0 -8
- data/dryad-consul/dryad-consul.gemspec +0 -30
- data/dryad-consul/lib/dryad/consul.rb +0 -23
- data/dryad-consul/lib/dryad/consul/config_provider.rb +0 -16
- data/dryad-consul/lib/dryad/consul/key_value_client.rb +0 -19
- data/dryad-consul/lib/dryad/consul/railtie.rb +0 -28
- data/dryad-consul/lib/dryad/consul/service.rb +0 -33
- data/dryad-consul/lib/dryad/consul/service_client.rb +0 -15
- data/dryad-consul/lib/dryad/consul/service_registry.rb +0 -46
- data/dryad-consul/lib/dryad/consul/version.rb +0 -5
- data/dryad-consul/spec/dryad/consul/config_provider_spec.rb +0 -18
- data/dryad-consul/spec/dryad/consul/key_value_client_spec.rb +0 -22
- data/dryad-consul/spec/dryad/consul/service_client_spec.rb +0 -6
- data/dryad-consul/spec/dryad/consul/service_registry_spec.rb +0 -33
- data/dryad-consul/spec/dryad/consul/service_spec.rb +0 -23
- data/dryad-consul/spec/dryad/consul_spec.rb +0 -11
- data/dryad-consul/spec/spec_helper.rb +0 -14
- data/dryad-core/.gitignore +0 -11
- data/dryad-core/.rspec +0 -3
- data/dryad-core/.travis.yml +0 -7
- data/dryad-core/Gemfile +0 -4
- data/dryad-core/Gemfile.lock +0 -35
- data/dryad-core/LICENSE +0 -19
- data/dryad-core/README.md +0 -35
- data/dryad-core/Rakefile +0 -6
- data/dryad-core/bin/console +0 -14
- data/dryad-core/bin/setup +0 -8
- data/dryad-core/dryad-core.gemspec +0 -27
- data/dryad-core/lib/dryad/core.rb +0 -15
- data/dryad-core/lib/dryad/core/config_desc.rb +0 -13
- data/dryad-core/lib/dryad/core/config_provider.rb +0 -9
- data/dryad-core/lib/dryad/core/load_balancing.rb +0 -8
- data/dryad-core/lib/dryad/core/portal.rb +0 -21
- data/dryad-core/lib/dryad/core/schema.rb +0 -9
- data/dryad-core/lib/dryad/core/service.rb +0 -39
- data/dryad-core/lib/dryad/core/service_instance.rb +0 -14
- data/dryad-core/lib/dryad/core/version.rb +0 -5
- data/dryad-core/spec/dryad/core/config_desc_spec.rb +0 -11
- data/dryad-core/spec/dryad/core/load_balancing_spec.rb +0 -6
- data/dryad-core/spec/dryad/core/portal_spec.rb +0 -13
- data/dryad-core/spec/dryad/core/schema_spec.rb +0 -7
- data/dryad-core/spec/dryad/core/service_instance_spec.rb +0 -7
- data/dryad-core/spec/dryad/core/service_spec.rb +0 -14
- data/dryad-core/spec/dryad/core_spec.rb +0 -14
- data/dryad-core/spec/spec_helper.rb +0 -14
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'securerandom'
|
2
|
-
|
3
|
-
module Dryad
|
4
|
-
module Core
|
5
|
-
class Portal
|
6
|
-
attr_accessor :id, :schema, :port, :pattern, :check, :non_certifications
|
7
|
-
|
8
|
-
DEFAULT_OPTIONS = {
|
9
|
-
:non_certifications => []
|
10
|
-
}
|
11
|
-
|
12
|
-
def initialize(options = DEFAULT_OPTIONS)
|
13
|
-
@id = SecureRandom.uuid
|
14
|
-
@schema = options[:schema]
|
15
|
-
@port = options[:port]
|
16
|
-
@pattern = options[:pattern]
|
17
|
-
@non_certifications = options[:non_certifications]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module Dryad
|
2
|
-
module Core
|
3
|
-
class Service
|
4
|
-
attr_accessor :name, :address, :group, :portals, :priority, :load_balancing
|
5
|
-
|
6
|
-
TYPE = "microservice"
|
7
|
-
|
8
|
-
DEFAULT_OPTIONS = {
|
9
|
-
:portals => [],
|
10
|
-
:load_balancing => []
|
11
|
-
}
|
12
|
-
|
13
|
-
def initialize(options = {})
|
14
|
-
options = DEFAULT_OPTIONS.merge(options)
|
15
|
-
@name = options[:name]
|
16
|
-
@address = options[:address]
|
17
|
-
@group = options[:group]
|
18
|
-
@portals = options[:portals]
|
19
|
-
@priority = options[:priority]
|
20
|
-
@load_balancing = options[:load_balancing]
|
21
|
-
end
|
22
|
-
|
23
|
-
def type_name
|
24
|
-
Dryad::Core::Service::TYPE
|
25
|
-
end
|
26
|
-
|
27
|
-
class << self
|
28
|
-
def full_name(schema, name)
|
29
|
-
case schema
|
30
|
-
when Schema::HTTP
|
31
|
-
name
|
32
|
-
else
|
33
|
-
"#{name}-#{schema}"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module Dryad
|
2
|
-
module Core
|
3
|
-
class ServiceInstance
|
4
|
-
attr_accessor :name, :schema, :address, :port
|
5
|
-
|
6
|
-
def initialize(options = {})
|
7
|
-
@name = options[:name]
|
8
|
-
@schema = options[:schema]
|
9
|
-
@address = options[:address]
|
10
|
-
@port = options[:port]
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
RSpec.describe Dryad::Core::ConfigDesc do
|
2
|
-
it "can be created and accessed" do
|
3
|
-
path = 'path/to/key'
|
4
|
-
payload = 'payload for path'
|
5
|
-
version = 1
|
6
|
-
cd = Dryad::Core::ConfigDesc.new(path, payload, version)
|
7
|
-
expect(cd.path).to eq(path)
|
8
|
-
expect(cd.payload).to eq(payload)
|
9
|
-
expect(cd.version).to eq(version)
|
10
|
-
end
|
11
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
RSpec.describe Dryad::Core::Portal do
|
2
|
-
it "creates with default options" do
|
3
|
-
portal = Dryad::Core::Portal.new
|
4
|
-
expect(portal.id).not_to be(nil)
|
5
|
-
expect(portal.non_certifications).to eq([])
|
6
|
-
end
|
7
|
-
|
8
|
-
it "creates portals with different id" do
|
9
|
-
portals = Array.new(100) { Dryad::Core::Portal.new }
|
10
|
-
ids_set = portals.map{|portal| portal.id }.to_set
|
11
|
-
expect(ids_set.count).to eq(portals.count)
|
12
|
-
end
|
13
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
RSpec.describe Dryad::Core::ServiceInstance do
|
2
|
-
it 'can be created and access' do
|
3
|
-
si = Dryad::Core::ServiceInstance.new(name: 'grpc-service', schema: 'grpc', address: 'localhost', port: 19000)
|
4
|
-
expect(si.name).to eq('grpc-service')
|
5
|
-
expect(si.schema).to eq('grpc')
|
6
|
-
end
|
7
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
RSpec.describe Dryad::Core::Service do
|
2
|
-
it "create with default options" do
|
3
|
-
service = Dryad::Core::Service.new
|
4
|
-
expect(service.type_name).to eq(Dryad::Core::Service::TYPE)
|
5
|
-
expect(service.portals).to eq([])
|
6
|
-
expect(service.load_balancing).to eq([])
|
7
|
-
end
|
8
|
-
|
9
|
-
it "create with options" do
|
10
|
-
service = Dryad::Core::Service.new(name: "rails", address: "localhost", group: "staging", priority: 10)
|
11
|
-
expect(service.name).to eq("rails")
|
12
|
-
expect(service.address).to eq("localhost")
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
RSpec.describe Dryad::Core do
|
2
|
-
it "raise configuration not found error" do
|
3
|
-
begin
|
4
|
-
raise Dryad::Core::ConfigurationNotFound, "not found config file."
|
5
|
-
rescue Dryad::Core::ConfigurationNotFound => e
|
6
|
-
expect(e).not_to be(nil)
|
7
|
-
expect(e.message).to eq("not found config file.")
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
it "has a version number" do
|
12
|
-
expect(Dryad::Core::VERSION).not_to be(nil)
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require "bundler/setup"
|
2
|
-
require "dryad/core"
|
3
|
-
|
4
|
-
RSpec.configure do |config|
|
5
|
-
# Enable flags like --only-failures and --next-failure
|
6
|
-
config.example_status_persistence_file_path = ".rspec_status"
|
7
|
-
|
8
|
-
# Disable RSpec exposing methods globally on `Module` and `main`
|
9
|
-
config.disable_monkey_patching!
|
10
|
-
|
11
|
-
config.expect_with :rspec do |c|
|
12
|
-
c.syntax = :expect
|
13
|
-
end
|
14
|
-
end
|