github.com/mailgun/holster/v4@v4.20.0/election/README.md (about) 1 ## Election Library 2 This is a network agnostic implementation of the leader election portion of the RAFT protocol. This library provides no 3 peer discovery mechanism, as such the user of this library must call `SetPeers()` on the node when the list of peers 4 changes. Users can use any third party service discovery mechanism, such as consul, etc, k8s, or memberlist. 5 6 For our internal uses we choose https://github.com/hashicorp/memberlist such that our services have as few external 7 dependencies as possible. 8 9 ### Usage 10 In order to use the library on the network the user must provide a `SendRPC()` function at initialization time. This 11 function will be called when RPC communication between `election.Node` is needed. A node that wishes to receive 12 an RPC call must in turn call `Node.ReceiveRPC()` when the RPC request is received by what ever network protocol the 13 user implements. 14 15 You can see a simple example of this using http by looking at `example_test.go`