class Etcd::Client

Included Modules

Defined in:

etcd/client.cr

Constructors

Instance Method Summary

Instance methods inherited from module Etcd::Stats

stats(kind : Symbol) : JSON::Any stats, stats_endpoint stats_endpoint

Instance methods inherited from module Etcd::Keys

compare_and_swap(key : String, opts : Options = Options.new) : Response compare_and_swap, create(key : String, opts : Options)
create(key : String)
create
, create_in_order(dir : String, opts : Options = Options.new) : Response create_in_order, delete(key : String, opts : Options = Options.new) : Response delete, exists?(key) exists?, get(key : String, opts : Options = Options.new) : Response get, key_endpoint key_endpoint, set(key : String, opts : Options = Options.new) : Response set, update(key : String, opts : Options)
update(key : String)
update
, watch(key : String, opts : Options = Options.new, timeout : Int32 = -1) : Response watch

Constructor Detail

def self.new(addrs : Array(String)) #

[View source]
def self.new(addrs : Array(String), &) #

[View source]

Instance Method Detail

def addrs : Array(String) #

Addresses like ['localhost:2379']


[View source]
def addrs=(addrs : Array(String)) #

Addresses like ['localhost:2379']


[View source]
def api_execute(path : String, method : String, params : Options = Options.new, timeout : Int32 | Nil = nil) : HTTP::Client::Response #

This method sends api request to etcd server.

This method has following parameters as argument

  • path - etcd server path (etcd server end point)
  • method - the request method used
  • options - any additional parameters used by request method (optional)

[View source]
def config : Config #

[View source]
def config=(config : Config) #

[View source]
def new_client : HTTP::Client #

This method returns a new client for a server from list It keeps an internal structure of healthy servers and picks one from the list Currently returns the first server


[View source]
def process_http_request(response : HTTP::Client::Response) : HTTP::Client::Response #

[View source]
def version #

Returns the etcd daemon version


[View source]
def version_prefix #

Returns the etcd api version that will be used for across API methods


[View source]