Class: Kumonos::Envoy::EnvoyConfig
- Inherits:
-
Struct
- Object
- Struct
- Kumonos::Envoy::EnvoyConfig
- Defined in:
- lib/kumonos/envoy.rb
Instance Attribute Summary collapse
-
#admin ⇒ Object
Returns the value of attribute admin.
-
#ds ⇒ Object
Returns the value of attribute ds.
-
#listener ⇒ Object
Returns the value of attribute listener.
-
#statsd ⇒ Object
Returns the value of attribute statsd.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#admin ⇒ Object
Returns the value of attribute admin
10 11 12 |
# File 'lib/kumonos/envoy.rb', line 10 def admin @admin end |
#ds ⇒ Object
Returns the value of attribute ds
10 11 12 |
# File 'lib/kumonos/envoy.rb', line 10 def ds @ds end |
#listener ⇒ Object
Returns the value of attribute listener
10 11 12 |
# File 'lib/kumonos/envoy.rb', line 10 def listener @listener end |
#statsd ⇒ Object
Returns the value of attribute statsd
10 11 12 |
# File 'lib/kumonos/envoy.rb', line 10 def statsd @statsd end |
#version ⇒ Object
Returns the value of attribute version
10 11 12 |
# File 'lib/kumonos/envoy.rb', line 10 def version @version end |
Class Method Details
.build(h) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/kumonos/envoy.rb', line 12 def build(h) ds = DiscoverService.build(h.fetch('ds')) new( h.fetch('version'), ds, h['statsd'] ? Cluster.build(h['statsd']) : nil, Listener.build(h.fetch('listener'), ds), Admin.build(h.fetch('admin')) ) end |
Instance Method Details
#to_h ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/kumonos/envoy.rb', line 24 def to_h h = super h.delete(:version) h.delete(:ds) h.delete(:statsd) h.delete(:listener) h[:admin] = admin.to_h h[:listeners] = [listener.to_h] h[:cluster_manager] = { cds: ds.to_h, clusters: [] } if statsd h[:statsd_tcp_cluster_name] = statsd.name h[:cluster_manager][:clusters] << statsd.to_h end h end |