Skip to content

team-telnyx/etcdex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b842d38 · May 23, 2024

History

65 Commits
Aug 2, 2023
May 23, 2024
Jun 24, 2022
Aug 2, 2023
Jun 28, 2022
Aug 2, 2023
Jun 22, 2022
May 4, 2023
Aug 2, 2023
Jun 23, 2022
Jul 11, 2022
Jun 29, 2022
Aug 2, 2023
Aug 2, 2023

Repository files navigation

EtcdEx

Elixir client for the etcd API v3 (gRPC based). All core features are supported. It includes reconnection, transaction, software transactional memory, high-level query builders and lease management, watchers.

Installation

The package can be installed by adding etcdex to your list of dependencies in mix.exs:

def deps do
  [
    {:etcdex, "~> 1.0"}
  ]
end

Documentation is available at HexDocs.

Usage

First, create a connection to your etcd cluster with:

EtcdEx.start_link(name: MyApp.Etcd)

or add one to your supervision tree:

Supervisor.start_link([
  {EtcdEx, name: MyApp.Etcd}
], strategy: :one_for_one)

Get a single key with:

EtcdEx.get(MyApp.Etcd, "/foo")

or list all keys with /foo prefix using:

EtcdEx.get(MyApp.Etcd, "/foo", prefix: true)

or list all keys after /foo using:

EtcdEx.get(MyApp.Etcd, "/foo", from_key: true)

Check the documentation for other options.

Telemetry

EtcdEx uses Telemetry to provide instrumentation. See the EtcdEx.Telemetry module for details on specific events.