dryad-consul 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/dryad-consul.gemspec +1 -1
- data/lib/dryad/consul/service_registry.rb +16 -7
- data/lib/dryad/consul/version.rb +1 -1
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2701d5efd60a687bd75565f917f7a35ef50b602189fb5e2d28ca4c7bee42c1d9
|
4
|
+
data.tar.gz: b8d4746b122dd6f08571649cad7f1659322042f8a668cc3c1f0713754613756e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 339174599854c19e0a5c309949dcc3c20b3edc7d4ba46e143b2a5f6d13981fac86d9d6c82fa1cecda1a249ba33f62ad7c5f3a17f813466992fe7c8b55ef17e93
|
7
|
+
data.tar.gz: 355bb3667656cd5dad05072aa08b7da36801a3e574d8af4601b8f0b2dc0b49884b00c6a06415cc7f109786233f8d38a6c2c7dafa70c482e61f7ec8c30e8f31bd
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dryad-consul (0.1.
|
5
|
-
diplomat
|
6
|
-
dryad-core (= 0.1.
|
4
|
+
dryad-consul (0.1.1)
|
5
|
+
diplomat (~> 2.2, >= 2.2.4)
|
6
|
+
dryad-core (= 0.1.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -13,10 +13,10 @@ GEM
|
|
13
13
|
diplomat (2.2.4)
|
14
14
|
deep_merge (~> 1.0, >= 1.0.1)
|
15
15
|
faraday (~> 0.9)
|
16
|
-
dryad-core (0.1.
|
16
|
+
dryad-core (0.1.1)
|
17
17
|
faraday (0.15.4)
|
18
18
|
multipart-post (>= 1.2, < 3)
|
19
|
-
multipart-post (2.1.
|
19
|
+
multipart-post (2.1.1)
|
20
20
|
rake (10.5.0)
|
21
21
|
rspec (3.8.0)
|
22
22
|
rspec-core (~> 3.8.0)
|
data/dryad-consul.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.add_dependency "dryad-core", Dryad::Consul::VERSION
|
25
|
-
spec.add_dependency "diplomat"
|
25
|
+
spec.add_dependency "diplomat", "~> 2.2", ">= 2.2.4"
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 2.0"
|
28
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -15,19 +15,28 @@ module Dryad
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def service_instances(name, schema, groups)
|
18
|
-
all_services =
|
19
|
-
|
18
|
+
all_services = ::Diplomat::Health.service(Dryad::Core::Service.full_name(schema, name))
|
19
|
+
service_instances = []
|
20
20
|
all_services.each do |service|
|
21
|
-
|
22
|
-
|
21
|
+
service_hash = service.Service
|
22
|
+
if !service_hash["Meta"].nil? && service_hash["Meta"].has_key?("group") &&
|
23
|
+
groups.include?(service_hash["Meta"]["group"])
|
24
|
+
service_instances << service_hash
|
25
|
+
else
|
26
|
+
groups.each do |group|
|
27
|
+
if service_hash["Tags"].include?("group = \"#{group}\"")
|
28
|
+
service_instances << service_hash
|
29
|
+
break
|
30
|
+
end
|
31
|
+
end
|
23
32
|
end
|
24
33
|
end
|
25
|
-
|
34
|
+
service_instances.map do |service|
|
26
35
|
Dryad::Core::ServiceInstance.new(
|
27
36
|
name: name,
|
28
37
|
schema: schema,
|
29
|
-
address: service
|
30
|
-
port: service
|
38
|
+
address: service["Address"],
|
39
|
+
port: service["Port"]
|
31
40
|
)
|
32
41
|
end
|
33
42
|
end
|
data/lib/dryad/consul/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dryad-consul
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pan Jie
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dryad-core
|
@@ -16,28 +16,34 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: diplomat
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.2'
|
31
34
|
- - ">="
|
32
35
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
36
|
+
version: 2.2.4
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.2'
|
38
44
|
- - ">="
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
46
|
+
version: 2.2.4
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: bundler
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|