Versions in this module Expand all Collapse all v3 v3.2.5 May 10, 2020 v3.2.4 May 10, 2020 Changes in this version + const DEVVersion + const DragonboatMajor + const DragonboatMinor + const DragonboatPatch + var ErrBadKey = errors.New("bad key try again later") + var ErrCanceled = errors.New("request canceled") + var ErrClusterAlreadyExist = errors.New("cluster already exist") + var ErrClusterClosed = errors.New("raft cluster already closed") + var ErrClusterNotBootstrapped = errors.New("cluster not bootstrapped") + var ErrClusterNotFound = errors.New("cluster not found") + var ErrClusterNotInitialized = errors.New("raft cluster not initialized yet") + var ErrClusterNotReady = errors.New("request dropped as the cluster is not ready") + var ErrClusterNotStopped = errors.New("cluster not stopped") + var ErrDeadlineNotSet = errors.New("deadline not set") + var ErrDirNotExist = errors.New("specified dir does not exist") + var ErrInvalidAddress = errors.New("invalid address") + var ErrInvalidClusterSettings = errors.New("cluster settings are invalid") + var ErrInvalidDeadline = errors.New("invalid deadline") + var ErrInvalidOperation = errors.New("invalid operation") + var ErrInvalidSession = errors.New("invalid session") + var ErrInvalidTarget = errors.New("invalid target node ID") + var ErrNoSnapshot = errors.New("no snapshot available") + var ErrNodeRemoved = errors.New("node removed") + var ErrPayloadTooBig = errors.New("payload is too big") + var ErrPendingConfigChangeExist = errors.New("pending config change request exist") + var ErrPendingLeaderTransferExist = errors.New("pending leader transfer exist") + var ErrPendingSnapshotRequestExist = errors.New("pending snapshot request exist") + var ErrRejected = errors.New("request rejected") + var ErrSystemBusy = errors.New("system is too busy try again later") + var ErrSystemStopped = errors.New("system stopped") + var ErrTimeout = errors.New("timeout") + var ErrTimeoutTooSmall = errors.New("specified timeout value is too small") + func GetTestFS() config.IFS + func IsTempError(err error) bool + func WriteHealthMetrics(w io.Writer) + type ClusterInfo struct + ClusterID uint64 + ConfigChangeIndex uint64 + IsLeader bool + IsObserver bool + IsWitness bool + NodeID uint64 + Nodes map[uint64]string + Pending bool + StateMachineType sm.Type + type INodeUser interface + Propose func(s *client.Session, cmd []byte, timeout time.Duration) (*RequestState, error) + ReadIndex func(timeout time.Duration) (*RequestState, error) + type MemFS = vfs.MemFS + type Membership struct + ConfigChangeID uint64 + Nodes map[uint64]string + Observers map[uint64]string + Removed map[uint64]struct{} + Witnesses map[uint64]string + type NodeHost struct + func NewNodeHost(nhConfig config.NodeHostConfig) (*NodeHost, error) + func (nh *NodeHost) CloseSession(ctx context.Context, session *client.Session) error + func (nh *NodeHost) GetClusterMembership(ctx context.Context, clusterID uint64) (*Membership, error) + func (nh *NodeHost) GetLeaderID(clusterID uint64) (uint64, bool, error) + func (nh *NodeHost) GetNewSession(ctx context.Context, clusterID uint64) (*client.Session, error) + func (nh *NodeHost) GetNoOPSession(clusterID uint64) *client.Session + func (nh *NodeHost) GetNodeHostInfo(opt NodeHostInfoOption) *NodeHostInfo + func (nh *NodeHost) GetNodeUser(clusterID uint64) (INodeUser, error) + func (nh *NodeHost) HasNodeInfo(clusterID uint64, nodeID uint64) bool + func (nh *NodeHost) NAReadLocalNode(rs *RequestState, query []byte) ([]byte, error) + func (nh *NodeHost) NodeHostConfig() config.NodeHostConfig + func (nh *NodeHost) Propose(session *client.Session, cmd []byte, timeout time.Duration) (*RequestState, error) + func (nh *NodeHost) ProposeSession(session *client.Session, timeout time.Duration) (*RequestState, error) + func (nh *NodeHost) RaftAddress() string + func (nh *NodeHost) ReadIndex(clusterID uint64, timeout time.Duration) (*RequestState, error) + func (nh *NodeHost) ReadLocalNode(rs *RequestState, query interface{}) (interface{}, error) + func (nh *NodeHost) RemoveData(clusterID uint64, nodeID uint64) error + func (nh *NodeHost) RequestAddNode(clusterID uint64, nodeID uint64, address string, configChangeIndex uint64, ...) (*RequestState, error) + func (nh *NodeHost) RequestAddObserver(clusterID uint64, nodeID uint64, address string, configChangeIndex uint64, ...) (*RequestState, error) + func (nh *NodeHost) RequestAddWitness(clusterID uint64, nodeID uint64, address string, configChangeIndex uint64, ...) (*RequestState, error) + func (nh *NodeHost) RequestCompaction(clusterID uint64, nodeID uint64) (*SysOpState, error) + func (nh *NodeHost) RequestDeleteNode(clusterID uint64, nodeID uint64, configChangeIndex uint64, ...) (*RequestState, error) + func (nh *NodeHost) RequestLeaderTransfer(clusterID uint64, targetNodeID uint64) error + func (nh *NodeHost) RequestSnapshot(clusterID uint64, opt SnapshotOption, timeout time.Duration) (*RequestState, error) + func (nh *NodeHost) StaleRead(clusterID uint64, query interface{}) (interface{}, error) + func (nh *NodeHost) StartCluster(initialMembers map[uint64]string, join bool, ...) error + func (nh *NodeHost) StartConcurrentCluster(initialMembers map[uint64]string, join bool, ...) error + func (nh *NodeHost) StartOnDiskCluster(initialMembers map[uint64]string, join bool, ...) error + func (nh *NodeHost) Stop() + func (nh *NodeHost) StopCluster(clusterID uint64) error + func (nh *NodeHost) StopNode(clusterID uint64, nodeID uint64) error + func (nh *NodeHost) SyncCloseSession(ctx context.Context, cs *client.Session) error + func (nh *NodeHost) SyncGetClusterMembership(ctx context.Context, clusterID uint64) (*Membership, error) + func (nh *NodeHost) SyncGetSession(ctx context.Context, clusterID uint64) (*client.Session, error) + func (nh *NodeHost) SyncPropose(ctx context.Context, session *client.Session, cmd []byte) (sm.Result, error) + func (nh *NodeHost) SyncRead(ctx context.Context, clusterID uint64, query interface{}) (interface{}, error) + func (nh *NodeHost) SyncRemoveData(ctx context.Context, clusterID uint64, nodeID uint64) error + func (nh *NodeHost) SyncRequestAddNode(ctx context.Context, clusterID uint64, nodeID uint64, address string, ...) error + func (nh *NodeHost) SyncRequestAddObserver(ctx context.Context, clusterID uint64, nodeID uint64, address string, ...) error + func (nh *NodeHost) SyncRequestAddWitness(ctx context.Context, clusterID uint64, nodeID uint64, address string, ...) error + func (nh *NodeHost) SyncRequestDeleteNode(ctx context.Context, clusterID uint64, nodeID uint64, configChangeIndex uint64) error + func (nh *NodeHost) SyncRequestSnapshot(ctx context.Context, clusterID uint64, opt SnapshotOption) (uint64, error) + type NodeHostInfo struct + ClusterInfoList []ClusterInfo + LogInfo []raftio.NodeInfo + RaftAddress string + type NodeHostInfoOption struct + SkipLogInfo bool + var DefaultNodeHostInfoOption NodeHostInfoOption + type RequestResult struct + func (rr *RequestResult) Aborted() bool + func (rr *RequestResult) Committed() bool + func (rr *RequestResult) Completed() bool + func (rr *RequestResult) Dropped() bool + func (rr *RequestResult) GetResult() sm.Result + func (rr *RequestResult) Rejected() bool + func (rr *RequestResult) SnapshotIndex() uint64 + func (rr *RequestResult) Terminated() bool + func (rr *RequestResult) Timeout() bool + type RequestResultCode int + func (c RequestResultCode) String() string + type RequestState struct + CompletedC chan RequestResult + func (r *RequestState) AppliedC() chan RequestResult + func (r *RequestState) Release() + func (r *RequestState) ResultC() chan RequestResult + type SnapshotOption struct + CompactionOverhead uint64 + ExportPath string + Exported bool + OverrideCompactionOverhead bool + var DefaultSnapshotOption SnapshotOption + type SysOpState struct + func (o *SysOpState) CompletedC() <-chan struct{} + func (o *SysOpState) ResultC() <-chan struct{} Other modules containing this package github.com/mkawserm/dragonboat