Class: Nonnative::ConfigurationReadiness
- Inherits:
-
Object
- Object
- Nonnative::ConfigurationReadiness
- Defined in:
- lib/nonnative/configuration_readiness.rb
Overview
Readiness check configuration for a managed process.
Readiness is optional. When present, each check declares a kind and explicit endpoint details
to poll after TCP readiness succeeds. HTTP checks issue a plain unauthenticated GET and accept a
final 2xx response. gRPC checks use the standard health Check over an insecure channel and accept
only SERVING. Non-ready results are retried until the process timeout elapses.
Constant Summary collapse
- KINDS =
%w[http grpc].freeze
Instance Attribute Summary collapse
-
#kind ⇒ String
Readiness check kind.
-
#path ⇒ String
Path-only HTTP readiness path.
-
#port ⇒ Integer
Process readiness port.
-
#service ⇒ String
GRPC health service name.
Instance Method Summary collapse
- #grpc? ⇒ Boolean
- #http? ⇒ Boolean
-
#initialize(value) ⇒ ConfigurationReadiness
constructor
A new instance of ConfigurationReadiness.
Constructor Details
#initialize(value) ⇒ ConfigurationReadiness
Returns a new instance of ConfigurationReadiness.
26 27 28 29 30 31 32 33 34 |
# File 'lib/nonnative/configuration_readiness.rb', line 26 def initialize(value) attributes = value.respond_to?(:to_h) ? value.to_h : value self.kind = attribute(attributes, :kind)&.to_s self.port = attribute(attributes, :port) self.path = attribute(attributes, :path) self.service = attribute(attributes, :service) validate! end |
Instance Attribute Details
#kind ⇒ String
Returns readiness check kind.
14 15 16 |
# File 'lib/nonnative/configuration_readiness.rb', line 14 def kind @kind end |
#path ⇒ String
Returns path-only HTTP readiness path.
20 21 22 |
# File 'lib/nonnative/configuration_readiness.rb', line 20 def path @path end |
#port ⇒ Integer
Returns process readiness port.
17 18 19 |
# File 'lib/nonnative/configuration_readiness.rb', line 17 def port @port end |
#service ⇒ String
Returns gRPC health service name.
23 24 25 |
# File 'lib/nonnative/configuration_readiness.rb', line 23 def service @service end |
Instance Method Details
#grpc? ⇒ Boolean
40 41 42 |
# File 'lib/nonnative/configuration_readiness.rb', line 40 def grpc? kind == 'grpc' end |
#http? ⇒ Boolean
36 37 38 |
# File 'lib/nonnative/configuration_readiness.rb', line 36 def http? kind == 'http' end |