Module: ApplicationConfiguration
- Included in:
- Application, CassandraConfiguration, ConsulConfiguration, RestConfiguration
- Defined in:
- lib/application_configuration.rb
Instance Method Summary collapse
- #config ⇒ Object
- #config_cassandra ⇒ Object
- #config_consul ⇒ Object
- #config_rest ⇒ Object
- #random_name ⇒ Object
Instance Method Details
#config ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/application_configuration.rb', line 4 def config { rest: config_rest, consul: config_consul, cassandra: config_cassandra } end |
#config_cassandra ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/application_configuration.rb', line 44 def config_cassandra { # user_name: '', # turn on if any # password: '', # turn on if any hosts: ['172.16.15.3'], port: 9042 } end |
#config_consul ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/application_configuration.rb', line 12 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-new", tls_skip_verify: false, method: "GET", interval: "10s", timeout: "1s" } } } config_consul[:consul_service_data][:port] = config_rest[:port] config_consul[:consul_service_data][:check][:http] = "http://#{config_rest[:host]}:#{config_rest[:port].to_s}/#{random_name}" config_consul end |
#config_rest ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/application_configuration.rb', line 36 def config_rest { host: 'localhost', port: 9292, path: '/api/v1' } end |
#random_name ⇒ Object
53 54 55 |
# File 'lib/application_configuration.rb', line 53 def random_name "health-check-#{SecureRandom.urlsafe_base64(8)}" end |