Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a single node in a distributed hash table, coordinated using services registered in Consul. Key membership is determined using rendezvous hashing to ensure even distribution of keys and minimal key membership changes when a Node fails or otherwise leaves the hash table.
Errors encountered when making blocking GET requests to the Consul agent API are logged using the log package.
func Join ¶
Join creates a new Node and adds it to the distributed hash table specified by the given name. The given id should be unique among all Nodes in the hash table.
func (*Node) Leave ¶
Leave removes the Node from the distributed hash table by de-registering it from Consul. Once Leave is called, the Node should be discarded. An error is returned if the Node is unable to successfully deregister itself from Consul. In that case, Consul's health check for the Node will fail and require manual cleanup.