Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RaftServer ¶
type RaftServer struct { protobuf.UnimplementedRaftServerServer // contains filtered or unexported fields }
func NewRaftServer ¶
func NewRaftServer(peers []string, httpAddr string, dataDir string, pulseSeconds int) *RaftServer
func StartRaftServer ¶
func StartRaftServer(ip, peerIps, port, dataDir string) *RaftServer
StartRaftServer start a raft server
func (*RaftServer) DeathNotify ¶
func (s *RaftServer) DeathNotify()
DeathNotify If a node is about to die, notify other nodes to elect a new leader as soon as possible before the node dies
func (*RaftServer) Join ¶
func (s *RaftServer) Join(peers []string) error
Join joins an existing cluster.
Click to show internal directories.
Click to hide internal directories.