Documentation ¶
Index ¶
- Variables
- type KVStore
- type Peer
- func (p *Peer) DelByNode(node string) int
- func (p *Peer) GenPeersFile(file string) error
- func (p *Peer) GetLeader() (addr, id string)
- func (p *Peer) IsApplyRight() bool
- func (p *Peer) IsIDRemoved(id uint64) bool
- func (p *Peer) Join(nodeId, addr string) error
- func (p *Peer) Leave(nodeId string) error
- func (p *Peer) Lookup(key string) []string
- func (p *Peer) Process(ctx context.Context, m raftpb.Message) error
- func (p *Peer) Propose(msg *message.Message) error
- func (p *Peer) ReportSnapshot(id uint64, status raft.SnapshotStatus)
- func (p *Peer) ReportUnreachable(id uint64)
- func (p *Peer) Stop()
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidID = errors.New("node name must be a number")
)
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func Setup ¶
Setup initiates a raft instance and returns a committed log entry channel and error channel. Proposals for log updates are sent over the provided the proposal channel. All log entries are replayed over the commit channel, followed by a nil message (to indicate the channel is current), then new log entries. To shutdown, close proposeC and read errorC.
func (*Peer) GenPeersFile ¶
func (*Peer) IsApplyRight ¶
func (*Peer) IsIDRemoved ¶
func (*Peer) ReportSnapshot ¶
func (*Peer) ReportUnreachable ¶
Click to show internal directories.
Click to hide internal directories.