dryad 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +10 -10
  3. data/dryad.gemspec +2 -0
  4. data/lib/dryad/version.rb +1 -1
  5. metadata +8 -81
  6. data/.gitignore +0 -11
  7. data/.rspec +0 -3
  8. data/.travis.yml +0 -19
  9. data/dryad-cluster/.gitignore +0 -11
  10. data/dryad-cluster/.rspec +0 -3
  11. data/dryad-cluster/Gemfile +0 -4
  12. data/dryad-cluster/Gemfile.lock +0 -50
  13. data/dryad-cluster/LICENSE +0 -19
  14. data/dryad-cluster/README.md +0 -35
  15. data/dryad-cluster/Rakefile +0 -6
  16. data/dryad-cluster/bin/console +0 -14
  17. data/dryad-cluster/bin/setup +0 -8
  18. data/dryad-cluster/dryad-cluster.gemspec +0 -31
  19. data/dryad-cluster/lib/dryad/cluster.rb +0 -40
  20. data/dryad-cluster/lib/dryad/cluster/railtie.rb +0 -15
  21. data/dryad-cluster/lib/dryad/cluster/round_robin.rb +0 -22
  22. data/dryad-cluster/lib/dryad/cluster/version.rb +0 -5
  23. data/dryad-cluster/spec/dryad/cluster/round_robin_spec.rb +0 -21
  24. data/dryad-cluster/spec/dryad/cluster_spec.rb +0 -42
  25. data/dryad-cluster/spec/spec_helper.rb +0 -16
  26. data/dryad-consul/.gitignore +0 -11
  27. data/dryad-consul/.rspec +0 -3
  28. data/dryad-consul/Gemfile +0 -4
  29. data/dryad-consul/Gemfile.lock +0 -45
  30. data/dryad-consul/LICENSE +0 -19
  31. data/dryad-consul/README.md +0 -35
  32. data/dryad-consul/Rakefile +0 -6
  33. data/dryad-consul/bin/console +0 -14
  34. data/dryad-consul/bin/setup +0 -8
  35. data/dryad-consul/dryad-consul.gemspec +0 -30
  36. data/dryad-consul/lib/dryad/consul.rb +0 -23
  37. data/dryad-consul/lib/dryad/consul/config_provider.rb +0 -16
  38. data/dryad-consul/lib/dryad/consul/key_value_client.rb +0 -19
  39. data/dryad-consul/lib/dryad/consul/railtie.rb +0 -28
  40. data/dryad-consul/lib/dryad/consul/service.rb +0 -33
  41. data/dryad-consul/lib/dryad/consul/service_client.rb +0 -15
  42. data/dryad-consul/lib/dryad/consul/service_registry.rb +0 -46
  43. data/dryad-consul/lib/dryad/consul/version.rb +0 -5
  44. data/dryad-consul/spec/dryad/consul/config_provider_spec.rb +0 -18
  45. data/dryad-consul/spec/dryad/consul/key_value_client_spec.rb +0 -22
  46. data/dryad-consul/spec/dryad/consul/service_client_spec.rb +0 -6
  47. data/dryad-consul/spec/dryad/consul/service_registry_spec.rb +0 -33
  48. data/dryad-consul/spec/dryad/consul/service_spec.rb +0 -23
  49. data/dryad-consul/spec/dryad/consul_spec.rb +0 -11
  50. data/dryad-consul/spec/spec_helper.rb +0 -14
  51. data/dryad-core/.gitignore +0 -11
  52. data/dryad-core/.rspec +0 -3
  53. data/dryad-core/.travis.yml +0 -7
  54. data/dryad-core/Gemfile +0 -4
  55. data/dryad-core/Gemfile.lock +0 -35
  56. data/dryad-core/LICENSE +0 -19
  57. data/dryad-core/README.md +0 -35
  58. data/dryad-core/Rakefile +0 -6
  59. data/dryad-core/bin/console +0 -14
  60. data/dryad-core/bin/setup +0 -8
  61. data/dryad-core/dryad-core.gemspec +0 -27
  62. data/dryad-core/lib/dryad/core.rb +0 -15
  63. data/dryad-core/lib/dryad/core/config_desc.rb +0 -13
  64. data/dryad-core/lib/dryad/core/config_provider.rb +0 -9
  65. data/dryad-core/lib/dryad/core/load_balancing.rb +0 -8
  66. data/dryad-core/lib/dryad/core/portal.rb +0 -21
  67. data/dryad-core/lib/dryad/core/schema.rb +0 -9
  68. data/dryad-core/lib/dryad/core/service.rb +0 -39
  69. data/dryad-core/lib/dryad/core/service_instance.rb +0 -14
  70. data/dryad-core/lib/dryad/core/version.rb +0 -5
  71. data/dryad-core/spec/dryad/core/config_desc_spec.rb +0 -11
  72. data/dryad-core/spec/dryad/core/load_balancing_spec.rb +0 -6
  73. data/dryad-core/spec/dryad/core/portal_spec.rb +0 -13
  74. data/dryad-core/spec/dryad/core/schema_spec.rb +0 -7
  75. data/dryad-core/spec/dryad/core/service_instance_spec.rb +0 -7
  76. data/dryad-core/spec/dryad/core/service_spec.rb +0 -14
  77. data/dryad-core/spec/dryad/core_spec.rb +0 -14
  78. data/dryad-core/spec/spec_helper.rb +0 -14
@@ -1,13 +0,0 @@
1
- module Dryad
2
- module Core
3
- class ConfigDesc
4
- attr_accessor :path, :payload, :version
5
-
6
- def initialize(path, payload, version)
7
- @path = path
8
- @payload = payload
9
- @version = version
10
- end
11
- end
12
- end
13
- end
@@ -1,9 +0,0 @@
1
- module Dryad
2
- module Core
3
- class ConfigProvider
4
- def load
5
- raise "Implement this method"
6
- end
7
- end
8
- end
9
- end
@@ -1,8 +0,0 @@
1
- module Dryad
2
- module Core
3
- module LoadBalancing
4
- URL_HASH = "url_chash"
5
- ROUND_ROBIN = "round_robin"
6
- end
7
- end
8
- end
@@ -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,9 +0,0 @@
1
- module Dryad
2
- module Core
3
- module Schema
4
- HTTP = "http"
5
- GRPC = "grpc"
6
- WEB_SOCKET = "web-socket"
7
- end
8
- end
9
- 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,5 +0,0 @@
1
- module Dryad
2
- module Core
3
- VERSION = '0.2.5'
4
- end
5
- 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,6 +0,0 @@
1
- RSpec.describe Dryad::Core::LoadBalancing do
2
- it "values are correct" do
3
- expect(Dryad::Core::LoadBalancing::URL_HASH).to eq("url_chash")
4
- expect(Dryad::Core::LoadBalancing::ROUND_ROBIN).to eq("round_robin")
5
- end
6
- 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::Schema do
2
- it "has valid values" do
3
- expect(Dryad::Core::Schema::HTTP).to eq("http")
4
- expect(Dryad::Core::Schema::GRPC).to eq("grpc")
5
- expect(Dryad::Core::Schema::WEB_SOCKET).to eq("web-socket")
6
- end
7
- 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