Documentation ¶
Index ¶
- type DummyStore
- type HTTPTransport
- type MemStorage
- type RaftNode
- func (r *RaftNode) IsIDRemoved(id uint64) bool
- func (r *RaftNode) Process(ctx context.Context, m raftpb.Message) error
- func (r *RaftNode) Propose(data []byte) error
- func (r *RaftNode) ProposeConfChange(cc raftpb.ConfChange) error
- func (r *RaftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus)
- func (r *RaftNode) ReportUnreachable(id uint64)
- func (r *RaftNode) Start() error
- func (r *RaftNode) Stop() error
- type RaftOption
- type Storage
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummyStore ¶
type DummyStore struct {
// contains filtered or unexported fields
}
func (*DummyStore) Commit ¶
func (s *DummyStore) Commit(data []byte) error
func (*DummyStore) GetSnapshot ¶
func (s *DummyStore) GetSnapshot() ([]byte, error)
func (*DummyStore) LoadSnapshot ¶
func (s *DummyStore) LoadSnapshot(data []byte) error
type HTTPTransport ¶
func (*HTTPTransport) ChangeConf ¶
func (t *HTTPTransport) ChangeConf(cc raftpb.ConfChange) error
func (*HTTPTransport) ErrorC ¶
func (t *HTTPTransport) ErrorC() <-chan error
func (*HTTPTransport) Start ¶
func (t *HTTPTransport) Start() error
func (*HTTPTransport) Stop ¶
func (t *HTTPTransport) Stop() error
type MemStorage ¶
type MemStorage struct { raft.MemoryStorage // contains filtered or unexported fields }
func NewMemStorage ¶
func NewMemStorage(walDir, snapDir string) (*MemStorage, error)
func (*MemStorage) IsEmpty ¶
func (s *MemStorage) IsEmpty() bool
type RaftNode ¶
type RaftNode struct {
// contains filtered or unexported fields
}
func NewRaftNode ¶
func NewRaftNode(opts ...RaftOption) (*RaftNode, error)
func (*RaftNode) IsIDRemoved ¶
func (*RaftNode) ProposeConfChange ¶
func (r *RaftNode) ProposeConfChange(cc raftpb.ConfChange) error
func (*RaftNode) ReportSnapshot ¶
func (r *RaftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus)
func (*RaftNode) ReportUnreachable ¶
type RaftOption ¶
func WithCommitFunc ¶
func WithCommitFunc(commitFunc func([]byte) error) RaftOption
func WithID ¶
func WithID(id int) RaftOption
func WithPeers ¶
func WithPeers(peers ...string) RaftOption
func WithStorage ¶
func WithStorage(m Storage) RaftOption
func WithTransport ¶
func WithTransport(t func(r *RaftNode) (Transport, error)) RaftOption
Click to show internal directories.
Click to hide internal directories.