dendrite 0.4.1 → 0.4.2
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/bin/add_proxy +18 -9
- data/bin/register +3 -0
- data/lib/dendrite/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d0f802a104f1332fd54dfd363f96f68ed3c862f
|
4
|
+
data.tar.gz: 639c00dccaaff88406e9527da5bae00d91b179d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f05cf860d8ef399600105c2aa6ebb6cac9f3af48312267273a221f3e1bd9c4b7e8c74f691cc479074734feb7563fe2a1f2fa2120d51abbc45b24fa300bf34af
|
7
|
+
data.tar.gz: 2e3063feb05283898875f31c38177b63e69061f608dd65b860175adbe92f5a34b0e50d7c7ea241c54479ff5cd6ce8c6d844c0530da921e84486a075f2e78e16b
|
data/bin/add_proxy
CHANGED
@@ -5,25 +5,34 @@ require 'optparse'
|
|
5
5
|
options = {}
|
6
6
|
OptionParser.new do |opts|
|
7
7
|
opts.banner = "Usage: proxy [options]"
|
8
|
-
opts.on("-s", "--
|
9
|
-
options[:
|
8
|
+
opts.on("-s", "--services SERVICE_NAME:PORT,..", "service name and port") do |v|
|
9
|
+
options[:services] = v
|
10
10
|
end
|
11
11
|
|
12
12
|
opts.on("-c", "--config CONFIG_FILE", "config file") do |v|
|
13
13
|
options[:config] = v
|
14
14
|
end
|
15
|
-
|
16
|
-
opts.on("-p", "--port PORT", "port") do |v|
|
17
|
-
options[:port] = v.to_i
|
18
|
-
end
|
19
15
|
end.parse!
|
20
16
|
|
17
|
+
services = options[:services].split(',').inject({}) do |hsh, name_port|
|
18
|
+
name, port = name_port.split(':')
|
19
|
+
name = name.strip
|
20
|
+
port = port.to_i
|
21
|
+
hsh[name] = port
|
22
|
+
hsh
|
23
|
+
end
|
24
|
+
|
25
|
+
puts "Loading config"
|
21
26
|
Dendrite::Config.load(source: options[:config])
|
22
|
-
|
27
|
+
puts "Loading graph"
|
23
28
|
graph = Dendrite::IO.load(source: Dendrite::Config.services_source)
|
24
29
|
raise Dendrite::InvalidData unless graph.valid?
|
25
|
-
raise Dendrite::UnknownService unless services.collect {|service_name| graph[service_name]}.all?
|
30
|
+
raise Dendrite::UnknownService unless services.keys.collect {|service_name| graph[service_name]}.all?
|
26
31
|
|
27
|
-
|
32
|
+
services.each do |name, port|
|
33
|
+
puts "adding proxy for #{name}"
|
34
|
+
Dendrite::Config.custom_frontend!(name: "custom_#{name}", port: port, backend_name: name)
|
35
|
+
end
|
28
36
|
synapse = Dendrite::Generators::Synapse.new(graph: graph, service_names: services, proxy: true)
|
29
37
|
Dendrite::IO.write(data: synapse.to_yaml, destination: Dendrite::Config.synapse_config_path)
|
38
|
+
|
data/bin/register
CHANGED
@@ -14,6 +14,7 @@ OptionParser.new do |opts|
|
|
14
14
|
end
|
15
15
|
end.parse!
|
16
16
|
|
17
|
+
puts "Loading config"
|
17
18
|
Dendrite::Config.load(source: options[:config])
|
18
19
|
graph = Dendrite::IO.load(source: Dendrite::Config.services_source)
|
19
20
|
|
@@ -28,8 +29,10 @@ services.uniq!
|
|
28
29
|
raise Dendrite::InvalidData unless graph.valid?
|
29
30
|
raise Dendrite::UnknownService unless services.collect {|service_name| graph[service_name]}.all?
|
30
31
|
|
32
|
+
puts "Generating synapse"
|
31
33
|
synapse = Dendrite::Generators::Synapse.new(graph: graph, service_names: services)
|
32
34
|
Dendrite::IO.write(data: synapse.to_yaml, destination: Dendrite::Config.synapse_config_path)
|
33
35
|
|
36
|
+
puts "Generating nerve"
|
34
37
|
nerve = Dendrite::Generators::Nerve.new(graph: graph, service_names: services)
|
35
38
|
Dendrite::IO.write(data: nerve.to_yaml, destination: Dendrite::Config.nerve_config_path)
|
data/lib/dendrite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dendrite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yagnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|