Module: Consulkit::Defaults
- Defined in:
- lib/consulkit/defaults.rb
Overview
Constant Summary collapse
- HTTP_ADDR =
'http://localhost:8500'
- HTTP_TOKEN =
nil
- MIDDLEWARE =
Faraday::RackBuilder.new do |builder| retry_exceptions = Faraday::Retry::Middleware::DEFAULT_EXCEPTIONS + [Consulkit::Error::Server] builder.use(Faraday::Request::Json) builder.use(Faraday::Response::Json) builder.use(Faraday::Retry::Middleware, exceptions: retry_exceptions) builder.use(Consulkit::Middleware::RaiseError) builder.adapter Faraday.default_adapter end
Class Method Summary collapse
Class Method Details
.connection_options ⇒ Object
28 29 30 |
# File 'lib/consulkit/defaults.rb', line 28 def {} end |
.http_addr ⇒ Object
32 33 34 |
# File 'lib/consulkit/defaults.rb', line 32 def http_addr ENV.fetch('CONSUL_HTTP_ADDR', HTTP_ADDR) end |
.http_token ⇒ Object
36 37 38 |
# File 'lib/consulkit/defaults.rb', line 36 def http_token ENV.fetch('CONSUL_HTTP_TOKEN', HTTP_TOKEN) end |
.middleware ⇒ Object
40 41 42 |
# File 'lib/consulkit/defaults.rb', line 40 def middleware MIDDLEWARE end |