View Source Spear.ClusterMember (Spear v1.4.1)
A struct representing a member of a cluster of EventStoreDBs
Summary
Types
A possible state for an EventStoreDB cluster member
A struct representing a member of a cluster of EventStoreDBs
Types
@type state() ::
:Initializing
| :DiscoverLeader
| :Unknown
| :PreReplica
| :CatchingUp
| :Clone
| :Follower
| :PreLeader
| :Leader
| :Manager
| :ShuttingDown
| :Shutdown
| :ReadOnlyLeaderless
| :PreReadOnlyReplica
| :ResigningLeader
A possible state for an EventStoreDB cluster member
@type t() :: %Spear.ClusterMember{ address: Mint.Types.address(), alive?: boolean(), instance_id: String.t(), port: :inet.port_number(), state: state(), timestamp: DateTime.t() | nil }
A struct representing a member of a cluster of EventStoreDBs
These are returned by Spear.cluster_info/2
.
Examples
iex> Spear.cluster_info(conn)
{:ok,
[
%Spear.ClusterMember{
address: "127.0.0.1",
alive?: true,
instance_id: "eba4c27f-e443-4b21-8756-00845bc5cda1",
port: 2113,
state: :Leader,
timestamp: ~U[2021-04-19 17:25:17.875824Z]
}
]}