Versions in this module Expand all Collapse all v1 v1.12.0 Jul 26, 2016 Changes in this version + var ErrAppendEntry = errors.New("raft: failed to append entry to logs") + var ErrApplyNotSpecified = errors.New("raft: apply method was not specified") + var ErrApplySnapshot = errors.New("raft: failed to apply snapshot on raft node") + var ErrCannotRemoveMember = errors.New(...) + var ErrConfChangeRefused = errors.New("raft: propose configuration change refused") + var ErrHealthCheckFailure = errors.New(...) + var ErrLostLeadership = errors.New("raft: failed to process the request: node lost leader status") + var ErrMemberRemoved = errors.New("raft: member was removed from the cluster") + var ErrNoClusterLeader = errors.New("raft: no elected cluster leader") + var ErrNoRaftMember = errors.New("raft: node is not yet part of a raft cluster") + var ErrRequestTooLarge = errors.New("raft: raft message is too large and can't be sent") + var ErrSetHardState = errors.New("raft: failed to set the hard state for log append entry") + var ErrStopped = errors.New("raft: failed to process the request: node is stopped") + func DefaultNodeConfig() *raft.Config + func DefaultRaftConfig() api.RaftConfig + func Register(server *grpc.Server, node *Node) + func WaitForCluster(ctx context.Context, n *Node) (cluster *api.Cluster, err error) + func WaitForLeader(ctx context.Context, n *Node) error + type LeadershipState int + const IsFollower + const IsLeader + type NewNodeOptions struct + Addr string + ClockSource clock.Clock + Config *raft.Config + ForceNewCluster bool + ID string + JoinAddr string + SendTimeout time.Duration + StateDir string + TLSCredentials credentials.TransportAuthenticator + TickInterval time.Duration + type Node struct + Address string + Config *raft.Config + Ctx context.Context + Error error + Server *grpc.Server + StateDir string + func NewNode(ctx context.Context, opts NewNodeOptions) *Node + func (n *Node) CanRemoveMember(id uint64) bool + func (n *Node) ConnectToMember(addr string, timeout time.Duration) (*membership.Member, error) + func (n *Node) GetMemberByNodeID(nodeID string) *membership.Member + func (n *Node) GetMemberlist() map[uint64]*api.RaftMember + func (n *Node) GetVersion() *api.Version + func (n *Node) IsLeader() bool + func (n *Node) IsMember() bool + func (n *Node) IsStopped() bool + func (n *Node) Join(ctx context.Context, req *api.JoinRequest) (*api.JoinResponse, error) + func (n *Node) JoinAndStart() error + func (n *Node) Leader() uint64 + func (n *Node) LeaderAddr() (string, error) + func (n *Node) Leave(ctx context.Context, req *api.LeaveRequest) (*api.LeaveResponse, error) + func (n *Node) MemoryStore() *store.MemoryStore + func (n *Node) ProcessRaftMessage(ctx context.Context, msg *api.ProcessRaftMessageRequest) (*api.ProcessRaftMessageResponse, error) + func (n *Node) ProposeValue(ctx context.Context, storeAction []*api.StoreAction, cb func()) error + func (n *Node) RemoveMember(ctx context.Context, id uint64) error + func (n *Node) ResolveAddress(ctx context.Context, msg *api.ResolveAddressRequest) (*api.ResolveAddressResponse, error) + func (n *Node) Run(ctx context.Context) error + func (n *Node) Shutdown() + func (n *Node) SubscribeLeadership() (q chan events.Event, cancel func())