close/1 | close connections with etcd server. |
get_prefix_range_end/1 | |
info/0 | etcd's overview. |
new/1 | Create context for request. |
open/2 | Connects to a etcd server on TCP port
Port on the host with IP address Address, such as:
open(test,["127.0.0.1:2379","127.0.0.1:2479","127.0.0.1:2579"]). |
open/4 | Connects to a etcd server. |
open/5 | Connects to a etcd server. |
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. |
close(Name::name()) -> ok | {error, eetcd_conn_unavailable}
close connections with etcd server.
get_prefix_range_end(Key) -> any()
info() -> any()
etcd's overview.
new(ConnName::atom() | reference()) -> context()
Create context for request.
open(Name::name(), Hosts::[string()]) -> {ok, pid()} | {error, any()}
Connects to a etcd server on TCP port
Port on the host with IP address Address, such as:
open(test,["127.0.0.1:2379","127.0.0.1:2479","127.0.0.1:2579"]).
open(Name::name(), Hosts::[string()], Transport::tcp | tls | ssl, TransportOpts::[gen_tcp:connect_option()] | [ssl:connect_option()]) -> {ok, pid()} | {error, any()}
Connects to a etcd server.
open(Name::name(), Hosts::[string()], Options::[{mode, connect_all | random} | {name, string()} | {password, string()}], Transport::tcp | tls | ssl, TransportOpts::[gen_tcp:connect_option()] | [ssl:connect_option()]) -> {ok, pid()} | {error, any()}
Connects to a etcd server. ssl:connect_option() see all options in ssl_api.hrl such as [{certfile, Certfile}, {keyfile, Keyfile}] or [{cert, Cert}, {key, Key}].
Default mode is connect_all
, it creates multiple sub-connections (one sub-connection per each endpoint).
The balancing policy is round robin.
For instance, in 5-node cluster, connect_all
would require 5 TCP connections,
This may consume more resources but provide more flexible load balance with better failover performance.
eetcd_conn
will do his best to keep all connections normal, and try to reconnect when connection is broken.
The reconnect millisecond is 200 400 800 1600 3200 6400 12800 25600, and keep recycling this reconnection time until normal.
{mode, random}
creates only one connection to a random endpoint,
it would pick one address and use it to send all client requests.
The pinned address is maintained until the client connection is closed.
When the client receives an error, it randomly picks another normal endpoint.
[{name, string()},{password, string()}]
generates an authentication token based on a given user name and password.
eetcd:info/0
to see the internal connection status.
Timeout is an integer greater than zero which specifies how many milliseconds to wait for a reply,
or the atom infinity to wait indefinitely.
If no reply is received within the specified time, the function call fails with {error, timeout}
.
Generated by EDoc