Class: Rubyists::Dapr::Client::Configuration
- Inherits:
-
Object
- Object
- Rubyists::Dapr::Client::Configuration
- Includes:
- Rubyists::Dapr::Client, SemanticLogger::Loggable
- Defined in:
- lib/dapr/client/configuration.rb
Overview
Handles publishing messages to Dapr pub/sub topics
Constant Summary collapse
- ConfigurationRequest =
The proto class for the GetConfiguration request
::Dapr::Proto::Runtime::V1::GetConfigurationRequest
- ConfigurationResponse =
The proto class for the GetConfiguration response
::Dapr::Proto::Runtime::V1::GetConfigurationResponse
- DEFAULT_STORE_NAME =
'dapr-config'
Constants included from Rubyists::Dapr::Client
DAPR_PORT, DAPR_STUB, DAPR_URI, Runtime
Instance Attribute Summary collapse
-
#keys ⇒ Object
readonly
The name of the configuration component, the keys we care about, and the metadata.
-
#metadata ⇒ Object
readonly
The name of the configuration component, the keys we care about, and the metadata.
-
#store_name ⇒ Object
readonly
The name of the configuration component, the keys we care about, and the metadata.
Class Method Summary collapse
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(store_name, keys: [], metadata: {}) ⇒ Configuration
constructor
Initialize the Configuration object.
Methods included from Rubyists::Dapr::Client
client, #client, singleton, #singleton
Constructor Details
#initialize(store_name, keys: [], metadata: {}) ⇒ Configuration
Initialize the Configuration object
33 34 35 36 37 |
# File 'lib/dapr/client/configuration.rb', line 33 def initialize(store_name, keys: [], metadata: {}) @store_name = store_name @keys = Array(keys) @metadata = end |
Instance Attribute Details
#keys ⇒ Object (readonly)
The name of the configuration component, the keys we care about, and the metadata
15 16 17 |
# File 'lib/dapr/client/configuration.rb', line 15 def keys @keys end |
#metadata ⇒ Object (readonly)
The name of the configuration component, the keys we care about, and the metadata
15 16 17 |
# File 'lib/dapr/client/configuration.rb', line 15 def @metadata end |
#store_name ⇒ Object (readonly)
The name of the configuration component, the keys we care about, and the metadata
15 16 17 |
# File 'lib/dapr/client/configuration.rb', line 15 def store_name @store_name end |
Class Method Details
.get(keys = [], store_name: DEFAULT_STORE_NAME, metadata: {}) ⇒ Object
23 24 25 26 |
# File 'lib/dapr/client/configuration.rb', line 23 def self.get(keys = [], store_name: DEFAULT_STORE_NAME, metadata: {}) configuration = new(store_name, keys:, metadata:) configuration.get end |
Instance Method Details
#get ⇒ Object
39 40 41 42 |
# File 'lib/dapr/client/configuration.rb', line 39 def get logger.debug('Getting configuration', keys:, store_name:) singleton.get_configuration(ConfigurationRequest.new(store_name:, keys:, metadata:)) end |