Class: Dryad::Consul::KeyValueClient

Inherits:
Object
  • Object
show all
Defined in:
lib/dryad/consul/key_value_client.rb

Class Method Summary collapse

Class Method Details

.get(path) ⇒ OpenStruct

Get a value by its key, potentially blocking for the first or next value

Parameters:

  • key (String)

    the key

Returns:

  • (OpenStruct)

    The base64-decoded value associated with the key



11
12
13
14
15
# File 'lib/dryad/consul/key_value_client.rb', line 11

def get(path)
  OpenStruct.new ::Diplomat::Kv.get(path, decode_values: true).first
rescue Diplomat::KeyNotFound
  nil
end