//! Raft consensus-based replication for high availability.
//!
//! Provides distributed consensus to ensure data consistency across
//! multiple database nodes with automatic leader election and failover.

pub mod cluster;
pub mod election;
pub mod log;
pub mod raft;
pub mod rpc;
pub mod snapshot;
pub mod state;

pub use cluster::{ClusterBuilder, ClusterConfig, NodeId, PeerAddress, PeerInfo, PeerState};
pub use election::{Election, ElectionResult, ElectionTimeout, VoteHandler};
pub use log::{LogEntry, ReplicatedLog};
pub use raft::{ApplyResult, RaftConfig, RaftEvent, RaftNode};
pub use rpc::{
    AppendEntries, AppendEntriesResponse, InstallSnapshot, InstallSnapshotResponse, RequestVote,
    RequestVoteResponse, RpcMessage,
};
pub use snapshot::{Snapshot, SnapshotConfig, SnapshotManager, SnapshotMetadata};
pub use state::{Command, LeaderState, NodeRole, RaftState};
