instructure_registrar 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/config/instructure_registrar.rb +4 -2
- data/instructure_registrar.gemspec +0 -1
- data/lib/instructure_registrar/client.rb +12 -5
- data/lib/instructure_registrar/version.rb +1 -1
- data/lib/instructure_registrar.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0e3c4c5ed5bb8cfc677bb3dca89cebf35e3d237
|
4
|
+
data.tar.gz: d6504ddc76c4cd021936ebf35362dee072bf80ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb1848b05a1a295c33f5512e0584d43566cd41eff4702fbb96ee8170e91c96cb645d991abd2dd394167188f42813baec0201a7a7bd350b1916da3d817b24cb06
|
7
|
+
data.tar.gz: c3fa8221b41e2aa416b602162f0d32c14cf300748d9b52c5e1f92a494c011222b3faf1a2a1e8d63e6fa68b528dbb0de8f2ca91f80ca604ae58c7f7c1d7a40ddf
|
data/README.md
CHANGED
@@ -38,6 +38,7 @@ In your service's project folder, create a configuration file with the following
|
|
38
38
|
config.service_name = "sample_service_3"
|
39
39
|
config.service_host = ENV['SERVICE_HOST'] || "http://localhost"
|
40
40
|
config.service_port = ENV['SERVICE_PORT'] || 3000
|
41
|
+
config.service_config = { token: 'foo', option: 'bar'}
|
41
42
|
end
|
42
43
|
|
43
44
|
if ENV['RAILS_ENV'] == "development"
|
@@ -6,8 +6,10 @@ InstructureRegistrar.configure do |config|
|
|
6
6
|
config.registry_host = ENV.fetch('REGISTRY_HOST') || "http://instructure-etcd.docker"
|
7
7
|
config.registry_port = ENV.fetch("REGISTRY_PORT") || 12379
|
8
8
|
config.service_name = "my.service.name"
|
9
|
-
|
10
|
-
|
9
|
+
confif.service_config = {
|
10
|
+
host: "localhost",
|
11
|
+
port: "3000"
|
12
|
+
}
|
11
13
|
end
|
12
14
|
|
13
15
|
InstructureRegistrar.register
|
@@ -27,16 +27,23 @@ module InstructureRegistrar
|
|
27
27
|
|
28
28
|
def register
|
29
29
|
return unless server_available
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
InstructureRegistrar.config.service_config.keys.each do |key|
|
31
|
+
client.set(
|
32
|
+
"/#{InstructureRegistrar.config.service_name}/#{key}",
|
33
|
+
value: InstructureRegistrar.config.service_config[key]
|
34
|
+
)
|
35
|
+
end
|
34
36
|
end
|
35
37
|
|
36
38
|
def unregister
|
37
39
|
return unless server_available
|
38
40
|
begin
|
39
|
-
|
41
|
+
InstructureRegistrar.config.service_config.keys.each do |key|
|
42
|
+
client.delete(
|
43
|
+
"/#{InstructureRegistrar.config.service_name}/#{key}",
|
44
|
+
value: InstructureRegistrar.config.service_config[key]
|
45
|
+
)
|
46
|
+
end
|
40
47
|
rescue Etcd::KeyNotFound
|
41
48
|
false
|
42
49
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instructure_registrar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CoralineAda
|
@@ -9,22 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: dotenv
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
21
|
-
type: :runtime
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: etcd
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|