module Etcd::Keys

Overview

Keys module provides the basic key value operations against etcd /keys namespace

Direct including types

Defined in:

etcd/keys.cr

Instance Method Summary

Instance Method Detail

def compare_and_swap(key : String, opts : Options = Options.new) : Response #

Set a new value for key if previous value of key is matched

This method takes the following parameters as arguments

  • key - whose value is going to change if previous value is matched
  • value - new value to be set for specified key
  • prevValue - value of a key to compare with existing value of key
  • ttl - shelf life of a key (in secsonds) (optional)

[View source]
def create(key : String, opts : Options) #

[View source]
def create(key : String) #

[View source]
def create_in_order(dir : String, opts : Options = Options.new) : Response #

[View source]
def delete(key : String, opts : Options = Options.new) : Response #

Deletes a key (and its content)

This method takes the following parameters as arguments

  • key - key to be deleted

[View source]
def exists?(key) #

[View source]
def get(key : String, opts : Options = Options.new) : Response #

Retrives a key with its associated data, if key is not present it will return with message "Key Not Found"

This method takes the following parameters as arguments

  • key - whose data is to be retrieved

[View source]
def key_endpoint #

return etcd endpoint that is reserved for key/value store


[View source]
def set(key : String, opts : Options = Options.new) : Response #

Create or update a new key

This method takes the following parameters as arguments

  • key - whose value to be set
  • value - value to be set for specified key
  • ttl - shelf life of a key (in seconds) (optional)

[View source]
def update(key : String, opts : Options) #

[View source]
def update(key : String) #

[View source]
def watch(key : String, opts : Options = Options.new, timeout : Int32 = -1) : Response #

Gives a notification when specified key changes

This method takes the following parameters as arguments @ key - key to be watched @options [Hash] additional options for watching a key @options [Fixnum] :index watch the specified key from given index @options [Fixnum] :timeout specify http timeout


[View source]