Documentation ¶
Index ¶
- Variables
- func NewSharedGroup(group *RaftGroup) (*sharedGroup, error)
- type Group
- type NodesManager
- type ProcessFn
- type RaftGroup
- func (this *RaftGroup) LeaderId() uint64
- func (this *RaftGroup) Propose(ctx context.Context, data []byte) error
- func (this *RaftGroup) ProposeJoin(nodeId uint64, address string) error
- func (this *RaftGroup) ProposeLeave(nodeId uint64) error
- func (this *RaftGroup) RegisterProcessFn(fn ProcessFn) error
- func (this *RaftGroup) RegisterProcessSnapshotFn(fn ProcessFn) error
- func (this *RaftGroup) RegisterSnapshotFn(fn SnapshotFn) error
- func (this *RaftGroup) Start() error
- func (this *RaftGroup) Stop()
- type RaftTransport
- type SnapshotFn
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewSharedGroup ¶
Types ¶
type NodesManager ¶
type NodesManager struct {
// contains filtered or unexported fields
}
func NewNodesManager ¶
func NewNodesManager(clusterConn *cluster.Conn, zeroGroup *RaftGroup) *NodesManager
func (*NodesManager) Join ¶
func (this *NodesManager) Join(ctx context.Context, addresses []string) error
func (*NodesManager) ListNodes ¶
func (this *NodesManager) ListNodes() map[uint64]string
func (*NodesManager) RemoveNode ¶
func (this *NodesManager) RemoveNode(id uint64) error
type RaftGroup ¶
type RaftGroup struct {
// contains filtered or unexported fields
}
func NewRaftGroup ¶
func (*RaftGroup) ProposeJoin ¶
func (*RaftGroup) ProposeLeave ¶
func (*RaftGroup) RegisterProcessFn ¶
func (*RaftGroup) RegisterProcessSnapshotFn ¶
func (*RaftGroup) RegisterSnapshotFn ¶
func (this *RaftGroup) RegisterSnapshotFn(fn SnapshotFn) error
type RaftTransport ¶
type RaftTransport struct {
// contains filtered or unexported fields
}
func NewTransport ¶
func NewTransport(nodeId uint64, address string, clusterConn *cluster.Conn) *RaftTransport
func (*RaftTransport) Address ¶
func (this *RaftTransport) Address() string
func (*RaftTransport) NodeId ¶
func (this *RaftTransport) NodeId() uint64
func (*RaftTransport) Receive ¶
func (this *RaftTransport) Receive(ctx context.Context, req *pb.RaftMessage) (*pb.EmptyMessage, error)
type SnapshotFn ¶
Click to show internal directories.
Click to hide internal directories.