Class: Dendrite::Generators::Nerve::ServiceConfig
- Inherits:
-
Struct
- Object
- Struct
- Dendrite::Generators::Nerve::ServiceConfig
- Extended by:
- Forwardable
- Defined in:
- lib/dendrite/generators/nerve.rb
Instance Attribute Summary collapse
-
#service ⇒ Object
Returns the value of attribute service.
Instance Method Summary collapse
Instance Attribute Details
#service ⇒ Object
Returns the value of attribute service
23 24 25 |
# File 'lib/dendrite/generators/nerve.rb', line 23 def service @service end |
Instance Method Details
#to_h ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/dendrite/generators/nerve.rb', line 29 def to_h { host: Dendrite::Config.public_ip, port: service.service_port || DEFAULT_PORT, labels: { dc: Dendrite::Config.dc, env: Dendrite::Config.env } }.merge(zookeeper_config) end |
#zookeeper_config ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/dendrite/generators/nerve.rb', line 40 def zookeeper_config { reporter_type: 'zookeeper', zk_hosts: Dendrite::Config.zk_hosts, zk_path: "/smartstack/services/#{organization}/#{component}/#{service.real_name}/instances" } end |