Module: ApplicationConfiguration
- Included in:
- Application, ConsulConfiguration, RestConfiguration
- Defined in:
- lib/application_configuration.rb
Instance Method Summary collapse
Instance Method Details
#config ⇒ Object
4 5 6 7 8 9 |
# File 'lib/application_configuration.rb', line 4 def config { rest: config_rest, consul: config_consul } end |
#config_consul ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/application_configuration.rb', line 11 def config_consul config_consul = { port: 8500, path: "http://localhost", consul_service_data: { name: "Service-1", id: "Service1", port: 9292, check: { id: "bluesky-api", name: "HTTP Health Check API on port 9292", http: "http://localhost:9292/health-check", tls_skip_verify: false, method: "GET", interval: "10s", timeout: "1s" } }, consul_check_http: "health-check-new" } config_consul[:consul_check_http] = config_rest[:consul_check_http] config_consul[:consul_service_data][:port] = config_rest[:port] config_consul[:consul_service_data][:check][:http] = "http://#{config_rest[:host]}:#{config_rest[:port]}/#{config_rest[:consul_check_http]}" config_consul end |
#config_rest ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/application_configuration.rb', line 37 def config_rest config_rest = { host: 'localhost:9292', path: '/api/v1', consul_check_http: random_name } end |
#random_name ⇒ Object
45 46 47 |
# File 'lib/application_configuration.rb', line 45 def random_name "/health-check-#{SecureRandom.urlsafe_base64(8)}" end |