compact/1 | Compact compacts etcd KV history before the given revision. |
compact/2 | Compact compacts etcd KV history before the given revision with options. |
delete/1 | Delete deletes a key, or optionally using eetcd_kv:with_range(End), [Key, End). |
delete/2 | Delete deletes a key with options. |
get/1 | Get retrieves keys. |
get/2 | Get retrieves keys with options. |
new/0 | |
new/1 | Create context for request. |
put/1 | Put puts a key-value pair into etcd. |
put/3 | Put puts a key-value pair into etcd with options put/1 |
txn/4 | Txn creates a transaction. |
with_count_only/1 | Make the get request return only the count of keys. |
with_first_create/1 | Get the key with the oldest creation revision in the request range. |
with_first_key/1 | Get the lexically first key in the request range. |
with_first_rev/1 | Get the key with the oldest modification revision in the request range. |
with_from_key/1 | Specifies the range of get , delete requests
to be equal or greater than the key in the argument. |
with_ignore_lease/1 | Update the key using its current lease. |
with_ignore_value/1 | Update the key using its current value. |
with_key/2 | Sets data for the request's key . |
with_keys_only/1 | Make the get request return only the keys and the corresponding
values will be omitted. |
with_last_create/1 | Get the lexically last key in the request range. |
with_last_key/1 | Get the lexically last key in the request range. |
with_last_rev/1 | Get the key with the latest modification revision in the request range. |
with_lease/2 | Attache a lease ID to a key in put request. |
with_limit/2 | Limit the number of results to return from get request. |
with_max_create_rev/2 | Filter out keys for get with creation revisions greater than the given revision. |
with_max_mod_rev/2 | Filter out keys for get with modification revisions greater than the given revision. |
with_min_create_rev/2 | Filter out keys for get with creation revisions less than the given revision. |
with_min_mod_rev/2 | Filter out keys for get with modification revisions less than the given revision. |
with_physical/1 | WithPhysical makes Compact wait until all compacted entries are removed from the etcd server's storage. |
with_prefix/1 | Enables get , delete requests to operate
on the keys with matching prefix. |
with_prev_kv/1 | Get the previous key-value pair before the event happens. |
with_range_end/2 | Sets data for the request's range_end . |
with_rev/2 | Specifies the store revision for get request. |
with_serializable/1 | Make get request serializable. |
with_sort/3 | Specifies the ordering in get request. |
with_timeout/2 | Timeout is an integer greater than zero which specifies how many milliseconds to wait for a reply, or the atom infinity to wait indefinitely. |
with_top/3 | Get the first key over the get's prefix given a sort order. |
with_value/2 | Sets data for the request's value . |
compact(Context::context()) -> {ok, router_pb:'Etcd.CompactionResponse'()} | {error, eetcd_error()}
Compact compacts etcd KV history before the given revision.
eetcd_kv:compact(ConnName,Revision).
eetcd_kv:compact(eetcd_kv:with_physical(eetcd_kv:with_revision(eetcd_kv:new(ConnName), Revision))).
:eetcd_kv.new(ConnName) |> :eetcd_kv.with_revision(revision) |> :eetcd_kv.with_physical() |> :eetcd_kv.compact()
eetcd_kv:with_revision/2
eetcd_kv:with_physical/1
compact(Context::name() | context(), Revision::integer()) -> {ok, router_pb:'Etcd.CompactionResponse'()} | {error, eetcd_error()}
Compact compacts etcd KV history before the given revision with options
delete(Context::context()) -> {ok, router_pb:'Etcd.DeleteRangeResponse'()} | {error, eetcd_error()}
Delete deletes a key, or optionally using eetcd_kv:with_range(End), [Key, End).
eetcd_kv:delete(ConnName,Key).
eetcd_kv:delete(eetcd_kv:with_range_end(eetcd_kv:with_key(eetcd_kv:new(ConnName),Key), End)).
:eetcd_kv.new(ConnName) |> :eetcd_kv.with_key(key) |> :eetcd_kv.with_range_end(rangeEnd) |> :eetcd_kv.with_prev_kv() |> :eetcd_kv.delete()
eetcd_kv:with_key/2
eetcd_kv:with_range_end/2
eetcd_kv:with_prev_kv/1
delete(Context::name() | context(), Key::key()) -> {ok, router_pb:'Etcd.DeleteRangeResponse'()} | {error, eetcd_error()}
Delete deletes a key with options
get(Context::context()) -> {ok, router_pb:'Etcd.RangeResponse'()} | {error, eetcd_error()}
Get retrieves keys.
By default, Get will return the value for Key, if any.
When passed eetcd_kv:with_range_end/2
, Get will return the keys in the range [Key, End)
.
When passed eetcd_kv:with_from_key/1
, Get returns keys greater than or equal to key.
When passed eetcd_kv:with_revision/2
with Rev > 0, Get retrieves keys at the given revision;
if the required revision is compacted, the request will fail with ErrCompacted.
When passed eetcd_kv:with_limit/1
, the number of returned keys is bounded by Limit.
When passed eetcd_kv:with_sort/3
, the keys will be sorted.
eetcd_kv:get(ConnName,Key).
eetcd_kv:get(eetcd_kv:with_range_end(eetcd_kv:with_key(eetcd_kv:new(ConnName),Key),End)).
:eetcd_kv.new(connName) |> :eetcd_kv.with_key(key) |> :eetcd_kv.with_range_end(rangeEnd) |> :eetcd_kv.with_limit(limit) |> :eetcd_kv.with_revision(rev) |> :eetcd_kv.with_sort(:'KEY', :'ASCEND') %% 'NONE' | 'ASCEND' | 'DESCEND' enum Etcd.RangeRequest.SortOrder |> :eetcd_kv.with_serializable() |> :eetcd_kv.with_keys_only() |> :eetcd_kv.with_count_only() |> :eetcd_kv.with_min_mod_revision(minModRev) |> :eetcd_kv.with_max_mod_revision(maxModRev) |> :eetcd_kv.with_min_create_revision(minCreateRev) |> :eetcd_kv.with_max_create_revision(maxCreateRev) |> :eetcd_kv:get()
eetcd_kv:with_key/2
eetcd_kv:with_range_end/2
eetcd_kv:with_limit/2
eetcd_kv:with_revision/2
eetcd_kv:with_sort/3
eetcd_kv:with_serializable/1
eetcd_kv:with_keys_only/1
eetcd_kv:with_count_only/1
eetcd_kv:with_min_mod_revision/2
eetcd_kv:with_max_mod_revision/2
eetcd_kv:with_min_create_revision/2
eetcd_kv:with_max_create_revision/2
get(Context::context() | name(), Key::key()) -> {ok, router_pb:'Etcd.RangeResponse'()} | {error, eetcd_error()}
Get retrieves keys with options.
new() -> context()
new(Context::atom() | reference()) -> context()
Create context for request.
put(Context::context()) -> {ok, router_pb:'Etcd.PutResponse'()} | {error, eetcd_error()}
Put puts a key-value pair into etcd.
eetcd_kv:put(ConnName, Key, Value).
eetcd_kv:put(Key, Value, eetcd_kv:with_lease(eetcd_kv:new(ConnName), LeaseID)).
:eetcd_kv.new(connName) |> :eetcd_kv.with_key(key) |> :eetcd_kv.with_value(value) |> :eetcd_kv.with_lease(leaseId) |> :eetcd_kv.with_ignore_value() |> :eetcd_kv.with_timeout(6000) |> :eetcd_kv.put()
eetcd_kv:with_key/2
, eetcd_kv:with_value/2
, eetcd_kv:with_lease/2
,
eetcd_kv:with_ignore_value/2
, eetcd_kv:with_ignore_lease/2
, eetcd_kv:with_timeout/2
put(Context::name() | context(), Key::key(), Value::value()) -> {ok, router_pb:'Etcd.PutResponse'()} | {error, eetcd_error()}
Put puts a key-value pair into etcd with options put/1
txn(Context::name() | context(), If::[router_pb:'Etcd.Compare'()], Then::[router_pb:'Etcd.RequestOp'()], Else::[router_pb:'Etcd.RequestOp'()]) -> {ok, router_pb:'Etcd.TxnResponse'()} | {error, eetcd_error()}
Txn creates a transaction.
Cmp = eetcd_compare:new(Key), If = eetcd_compare:value(Cmp, ">", Value), Then = eetcd_op:put(eetcd_kv:with_value(eetcd_kv:with_key(eetcd_kv:new(), Key), NewValue)), Else = eetcd_op:delete(eetcd_kv:with_key(eetcd_kv:new(), Key)), eetcd_kv:txn(EtcdConnName, If, Then, Else).
eetcd_compare:new/1
eetcd_compare:with_range/2
eetcd_compare:value/3
eetcd_compare:version/3
eetcd_compare:mod_revision/3
eetcd_compare:create_revision/3
eetcd_compare:lease/3
eetcd_op:put/1
eetcd_op:get/1
eetcd_op:delete/1
eetcd_op:txn/1
Make the get
request return only the count of keys.
Get the key with the oldest creation revision in the request range.
Get the lexically first key in the request range.
Get the key with the oldest modification revision in the request range.
Specifies the range of get
, delete
requests
to be equal or greater than the key in the argument.
Update the key using its current lease.
This option can not be combined with with_lease/2
.
Returns an error if the key does not exist.
Update the key using its current value. This option can not be combined with non-empty values. Returns an error if the key does not exist.
Sets data for the request's key
.
Make the get
request return only the keys and the corresponding
values will be omitted.
Get the lexically last key in the request range.
Get the lexically last key in the request range.
Get the key with the latest modification revision in the request range.
Attache a lease ID to a key in put
request.
Limit the number of results to return from get
request.
If with_limit is given a 0 limit, it is treated as no limit.
Filter out keys for get
with creation revisions greater than the given revision.
Filter out keys for get
with modification revisions greater than the given revision.
Filter out keys for get
with creation revisions less than the given revision.
Filter out keys for get
with modification revisions less than the given revision.
WithPhysical makes Compact wait until all compacted entries are removed from the etcd server's storage.
Enables get
, delete
requests to operate
on the keys with matching prefix. For example, get(with_prefix(with_key(Ctx, "foo"))
can return 'foo1', 'foo2', and so on.
Get the previous key-value pair before the event happens. If the previous KV is already compacted, nothing will be returned.
Sets data for the request's range_end
.
Specifies the store revision for get
request.
Make get
request serializable. By default,
it's linearizable. Serializable requests are better for lower latency
requirement.
with_sort(Context::context(), Target::'KEY' | 'VERSION' | 'VALUE' | 'CREATE' | 'MOD', Order::'NONE' | 'ASCEND' | 'DESCEND') -> context()
Specifies the ordering in get
request. It requires
with_range
and/or with_prefix
to be specified too.
target
specifies the target to sort by: 'KEY', 'VERSION', 'VALUE', 'CREATE', 'MOD'.
order
can be either 'NONE', 'ASCEND', 'DESCEND'.
Timeout is an integer greater than zero which specifies how many milliseconds to wait for a reply,
or the atom infinity to wait indefinitely. Default value is 5000.
If no reply is received within the specified time, the function call fails with {error, timeout}
.
with_top(Context::context(), SortTarget::'KEY' | 'VERSION' | 'VALUE' | 'CREATE' | 'MOD', SortOrder::'NONE' | 'ASCEND' | 'DESCEND') -> context()
Get the first key over the get's prefix given a sort order
Sets data for the request's value
.
Generated by EDoc