https://github.com/bsm/redeoraft
Raft transport implementation for Redeo servers #raft #golang #redeo #redis
https://github.com/bsm/redeoraft
Last synced: about 1 year ago
JSON representation
Raft transport implementation for Redeo servers #raft #golang #redeo #redis
- Host: GitHub
- URL: https://github.com/bsm/redeoraft
- Owner: bsm
- License: other
- Created: 2017-06-23T09:26:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-24T13:22:35.000Z (over 8 years ago)
- Last Synced: 2025-03-22T19:02:35.193Z (about 1 year ago)
- Language: Go
- Size: 34.2 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Redeo Raft
[](https://godoc.org/github.com/bsm/redeoraft)
[](https://travis-ci.org/bsm/redeoraft)
[](https://goreportcard.com/report/github.com/bsm/redeoraft)
[](https://opensource.org/licenses/Apache-2.0)
Raft transport implementation for Redeo servers.
## Example
```go
func run() {
// Init server with default config
srv := redeo.NewServer(nil)
// Init a new transport, this installs three new commands on your
// server:
// * raftappend - appends replicated log entries from leader
// * raftvote - replies to vote requests in an leadership election
// * raftsnapshot - installs a snapshot
tsp := redeoraft.NewTransport(srv, "10.0.0.1:9736", &redeoraft.Config{
Timeout: time.Minute,
})
defer tsp.Close()
// Use the transport in your raft configuration
rft, err := raft.NewRaft(raft.DefaultConfig(), &ExampleRaftService{}, raft.NewInmemStore(), raft.NewInmemStore(), raft.NewInmemSnapshotStore(), tsp)
if err != nil {
panic(err)
}
defer rft.Shutdown()
}
```
## Dependencies
* [library-v2-stage-one](https://github.com/hashicorp/raft/tree/library-v2-stage-one) branch of Hashicorp's Raft implementation