Skip to content

place-labs/crystal-etcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crystal-etcd

CI

etcd client for crystal lang implemented as a thin wrapper over etcd's gRPC-HTTP gateway.

The minimum supported etcd version is 3.4.

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  etcd:
    github: place-labs/crystal-etcd
  1. Run shards install

Usage

require "etcd"

# Initialising a client from ETCD_HOST and ETCD_PORT
client = Etcd.from_env

# Add a key/value to etcd
client.kv.put("/service/hello", "world")
# Grab a key/value from etcd
client.range("/service/hello").kvs.try(&.first?) #=> #<Etcd::Model::KV @key="/service/hello" @value="world" @create_revision=nil  @mod_revision=nil @version=nil @lease=nil>

TODO

  • Auth.
  • Multi-node.

Auth

  • authenticate
  • disable
  • enable
  • role/add
  • role/delete
  • role/get
  • role/grant
  • role/list
  • role/revoke
  • user/add
  • user/changepw
  • user/delete
  • user/get
  • user/grant
  • user/list
  • user/revoke

Cluster

  • member/add
  • member/list
  • member/promote
  • member/remove
  • member/update

Kv

  • put
  • range
  • deleterange
  • compaction
  • txn

Lease

  • grant
  • keepalive
  • leases
  • revoke
  • timetolive

Maintenance

  • alarm
  • defragment
  • hash
  • snapshot
  • status
  • transfer-leadership

Watch

  • watch

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

See Also

Contributors