Class: Nonnative::ConfigurationServiceReadiness
- Inherits:
-
Object
- Object
- Nonnative::ConfigurationServiceReadiness
- Defined in:
- lib/nonnative/configuration_service_readiness.rb
Overview
Service readiness check configuration.
Service readiness is for externally managed dependencies. The TCP target should be the dependency endpoint that must be reachable before managed servers and processes start.
Constant Summary collapse
- KINDS =
%w[tcp].freeze
Instance Attribute Summary collapse
-
#host ⇒ String
readonly
Readiness target host.
-
#kind ⇒ String
readonly
Readiness check kind.
-
#port ⇒ Integer
readonly
Readiness target port.
Instance Method Summary collapse
- #initialize(value) ⇒ void constructor
-
#tcp? ⇒ Boolean
Returns whether this is a TCP readiness check.
Constructor Details
#initialize(value) ⇒ void
22 23 24 25 26 27 28 29 30 |
# File 'lib/nonnative/configuration_service_readiness.rb', line 22 def initialize(value) attributes = value.to_h.transform_keys(&:to_sym) @kind = attributes[:kind]&.to_s @host = attributes[:host] @port = attributes[:port] validate! end |
Instance Attribute Details
#host ⇒ String (readonly)
Returns readiness target host.
15 16 17 |
# File 'lib/nonnative/configuration_service_readiness.rb', line 15 def host @host end |
#kind ⇒ String (readonly)
Returns readiness check kind.
12 13 14 |
# File 'lib/nonnative/configuration_service_readiness.rb', line 12 def kind @kind end |
#port ⇒ Integer (readonly)
Returns readiness target port.
18 19 20 |
# File 'lib/nonnative/configuration_service_readiness.rb', line 18 def port @port end |
Instance Method Details
#tcp? ⇒ Boolean
Returns whether this is a TCP readiness check.
35 36 37 |
# File 'lib/nonnative/configuration_service_readiness.rb', line 35 def tcp? kind == 'tcp' end |