raft

package
v0.8.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyMsg

type ApplyMsg struct {
	Index    uint64
	Term     uint64
	Entry    internal.LogEntry
	ResultCh chan error
}

ApplyMsg represents a message to apply to the state machine.

type CandidateState

type CandidateState struct {
	// contains filtered or unexported fields
}

CandidateState manages candidate-specific state and operations.

func NewCandidateState

func NewCandidateState(nodeID string, electionTimeout time.Duration, logger forge.Logger) *CandidateState

NewCandidateState creates a new candidate state.

func (*CandidateState) GetElectionDuration

func (cs *CandidateState) GetElectionDuration() time.Duration

GetElectionDuration returns how long the election has been running.

func (*CandidateState) GetQuorumProgress

func (cs *CandidateState) GetQuorumProgress() float64

GetQuorumProgress returns progress towards quorum as a percentage.

func (*CandidateState) GetStatus

func (cs *CandidateState) GetStatus() CandidateStatus

GetStatus returns candidate status.

func (*CandidateState) GetTerm

func (cs *CandidateState) GetTerm() uint64

GetTerm returns the election term.

func (*CandidateState) GetVoteCount

func (cs *CandidateState) GetVoteCount() (granted, denied, needed int)

GetVoteCount returns the current vote counts.

func (*CandidateState) GetVoters

func (cs *CandidateState) GetVoters() map[string]bool

GetVoters returns all nodes that have voted and their decisions.

func (*CandidateState) HasElectionTimedOut

func (cs *CandidateState) HasElectionTimedOut() bool

HasElectionTimedOut checks if the election has timed out.

func (*CandidateState) HasLostElection

func (cs *CandidateState) HasLostElection(totalNodes int) bool

HasLostElection checks if the candidate has definitively lost.

func (*CandidateState) HasWonElection

func (cs *CandidateState) HasWonElection() bool

HasWonElection checks if the candidate has won the election.

func (*CandidateState) IsStillViable

func (cs *CandidateState) IsStillViable(totalNodes int) bool

IsStillViable checks if the election is still viable.

func (*CandidateState) RecordVote

func (cs *CandidateState) RecordVote(voterID string, granted bool)

RecordVote records a vote response.

func (*CandidateState) Start

func (cs *CandidateState) Start(ctx context.Context, term uint64, clusterSize int) error

Start starts a new election.

func (*CandidateState) Stop

func (cs *CandidateState) Stop(ctx context.Context) error

Stop stops the candidate state.

type CandidateStatus

type CandidateStatus struct {
	NodeID           string
	Term             uint64
	VotesGranted     int
	VotesDenied      int
	VotesNeeded      int
	TotalVotes       int
	ElectionStarted  time.Time
	ElectionDuration time.Duration
	ElectionTimeout  time.Duration
	TimeRemaining    time.Duration
}

CandidateStatus represents candidate status.

type Config

type Config struct {
	// Node identification
	NodeID    string `json:"node_id"    yaml:"node_id"`
	ClusterID string `json:"cluster_id" yaml:"cluster_id"`

	// Timing parameters
	ElectionTimeoutMin time.Duration `json:"election_timeout_min" yaml:"election_timeout_min"`
	ElectionTimeoutMax time.Duration `json:"election_timeout_max" yaml:"election_timeout_max"`
	HeartbeatInterval  time.Duration `json:"heartbeat_interval"   yaml:"heartbeat_interval"`
	HeartbeatTimeout   time.Duration `json:"heartbeat_timeout"    yaml:"heartbeat_timeout"`
	ApplyInterval      time.Duration `json:"apply_interval"       yaml:"apply_interval"`
	CommitTimeout      time.Duration `json:"commit_timeout"       yaml:"commit_timeout"`

	// Snapshot configuration
	SnapshotInterval  time.Duration `json:"snapshot_interval"  yaml:"snapshot_interval"`
	SnapshotThreshold uint64        `json:"snapshot_threshold" yaml:"snapshot_threshold"`
	EnableSnapshots   bool          `json:"enable_snapshots"   yaml:"enable_snapshots"`

	// Replication configuration
	MaxAppendEntries     int           `json:"max_append_entries"     yaml:"max_append_entries"`
	ReplicationBatchSize int           `json:"replication_batch_size" yaml:"replication_batch_size"`
	ReplicationTimeout   time.Duration `json:"replication_timeout"    yaml:"replication_timeout"`
	EnablePipeline       bool          `json:"enable_pipeline"        yaml:"enable_pipeline"`

	// Performance tuning
	MaxInflightReplications int           `json:"max_inflight_replications" yaml:"max_inflight_replications"`
	BatchInterval           time.Duration `json:"batch_interval"            yaml:"batch_interval"`
	MaxBatchSize            int           `json:"max_batch_size"            yaml:"max_batch_size"`

	// Log configuration
	MaxLogEntries        uint64 `json:"max_log_entries"        yaml:"max_log_entries"`
	LogCacheSize         int    `json:"log_cache_size"         yaml:"log_cache_size"`
	LogCompactionEnabled bool   `json:"log_compaction_enabled" yaml:"log_compaction_enabled"`
	TrailingLogs         uint64 `json:"trailing_logs"          yaml:"trailing_logs"`

	// Safety
	PreVoteEnabled bool `json:"pre_vote_enabled" yaml:"pre_vote_enabled"`
	CheckQuorum    bool `json:"check_quorum"     yaml:"check_quorum"`

	// Observability
	EnableMetrics bool `json:"enable_metrics" yaml:"enable_metrics"`
	EnableTracing bool `json:"enable_tracing" yaml:"enable_tracing"`
}

Config contains Raft algorithm configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default Raft configuration.

func DevelopmentConfig

func DevelopmentConfig() Config

DevelopmentConfig returns a development-friendly configuration.

func ProductionConfig

func ProductionConfig() Config

ProductionConfig returns a production-ready configuration.

func TestConfig

func TestConfig() Config

TestConfig returns a configuration optimized for testing.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

func (*Config) WithElectionTimeout

func (c *Config) WithElectionTimeout(min, max time.Duration) *Config

WithElectionTimeout sets the election timeout range.

func (*Config) WithHeartbeatInterval

func (c *Config) WithHeartbeatInterval(interval time.Duration) *Config

WithHeartbeatInterval sets the heartbeat interval.

func (*Config) WithLogSettings

func (c *Config) WithLogSettings(maxEntries, trailingLogs uint64, compactionEnabled bool) *Config

WithLogSettings sets log configuration.

func (*Config) WithNodeID

func (c *Config) WithNodeID(nodeID string) *Config

WithNodeID sets the node ID.

func (*Config) WithObservability

func (c *Config) WithObservability(metrics, tracing bool) *Config

WithObservability sets observability configuration.

func (*Config) WithPerformanceSettings

func (c *Config) WithPerformanceSettings(maxInflight int, batchInterval time.Duration, maxBatchSize int) *Config

WithPerformanceSettings sets performance tuning parameters.

func (*Config) WithReplicationSettings

func (c *Config) WithReplicationSettings(maxEntries, batchSize int, timeout time.Duration) *Config

WithReplicationSettings sets replication configuration.

func (*Config) WithSafetySettings

func (c *Config) WithSafetySettings(preVote, checkQuorum bool) *Config

WithSafetySettings sets safety configuration.

func (*Config) WithSnapshotSettings

func (c *Config) WithSnapshotSettings(interval time.Duration, threshold uint64) *Config

WithSnapshotSettings sets snapshot configuration.

type ConfigChangeMsg

type ConfigChangeMsg struct {
	Type     ConfigChangeType
	NodeID   string
	Address  string
	Port     int
	ResultCh chan error
}

ConfigChangeMsg represents a configuration change message.

type ConfigChangeType

type ConfigChangeType int

ConfigChangeType represents the type of configuration change.

const (
	// ConfigChangeAdd adds a node to the cluster.
	ConfigChangeAdd ConfigChangeType = iota
	// ConfigChangeRemove removes a node from the cluster.
	ConfigChangeRemove
)

type ElectionResult

type ElectionResult struct {
	Won          bool
	Term         uint64
	VotesFor     int
	VotesAgainst int
	VotesNeeded  int
}

ElectionResult represents the result of an election.

type FollowerState

type FollowerState struct {
	// contains filtered or unexported fields
}

FollowerState manages follower-specific state and operations.

func NewFollowerState

func NewFollowerState(nodeID string, electionTimeout time.Duration, logger forge.Logger) *FollowerState

NewFollowerState creates a new follower state.

func (*FollowerState) ClearLeader

func (fs *FollowerState) ClearLeader()

ClearLeader clears the current leader.

func (*FollowerState) GetCurrentLeader

func (fs *FollowerState) GetCurrentLeader() string

GetCurrentLeader returns the current leader.

func (*FollowerState) GetElectionTimeout

func (fs *FollowerState) GetElectionTimeout() time.Duration

GetElectionTimeout returns the election timeout.

func (*FollowerState) GetLastHeartbeat

func (fs *FollowerState) GetLastHeartbeat() time.Time

GetLastHeartbeat returns the last heartbeat time.

func (*FollowerState) GetStatus

func (fs *FollowerState) GetStatus() FollowerStatus

GetStatus returns follower status.

func (*FollowerState) GetTimeSinceLastHeartbeat

func (fs *FollowerState) GetTimeSinceLastHeartbeat() time.Duration

GetTimeSinceLastHeartbeat returns time since last heartbeat.

func (*FollowerState) HasHeartbeatTimedOut

func (fs *FollowerState) HasHeartbeatTimedOut() bool

HasHeartbeatTimedOut checks if election timeout has expired.

func (*FollowerState) IsHealthy

func (fs *FollowerState) IsHealthy() bool

IsHealthy checks if follower is healthy (receiving heartbeats).

func (*FollowerState) RecordHeartbeat

func (fs *FollowerState) RecordHeartbeat(leaderID string)

RecordHeartbeat records a heartbeat from the leader.

func (*FollowerState) ResetHeartbeatTimer

func (fs *FollowerState) ResetHeartbeatTimer()

ResetHeartbeatTimer resets the heartbeat timer.

func (*FollowerState) SetElectionTimeout

func (fs *FollowerState) SetElectionTimeout(timeout time.Duration)

SetElectionTimeout sets the election timeout.

func (*FollowerState) Start

func (fs *FollowerState) Start(ctx context.Context) error

Start starts the follower state.

func (*FollowerState) Stop

func (fs *FollowerState) Stop(ctx context.Context) error

Stop stops the follower state.

type FollowerStatus

type FollowerStatus struct {
	NodeID             string
	CurrentLeader      string
	LastHeartbeat      time.Time
	TimeSinceHeartbeat time.Duration
	ElectionTimeout    time.Duration
	TimeUntilTimeout   time.Duration
	Healthy            bool
}

FollowerStatus represents follower status.

type LeaderState

type LeaderState struct {
	// contains filtered or unexported fields
}

LeaderState manages leader-specific state and operations.

func NewLeaderState

func NewLeaderState(nodeID string, heartbeatInterval time.Duration, logger forge.Logger) *LeaderState

NewLeaderState creates a new leader state.

func (*LeaderState) AddPeer

func (ls *LeaderState) AddPeer(peerID string, nextIndex uint64)

AddPeer adds a new peer to track.

func (*LeaderState) CalculateCommitIndex

func (ls *LeaderState) CalculateCommitIndex(currentCommitIndex, lastLogIndex uint64) uint64

CalculateCommitIndex calculates the new commit index based on majority replication.

func (*LeaderState) DecrementNextIndex

func (ls *LeaderState) DecrementNextIndex(peerID string) uint64

DecrementNextIndex decrements the next index for a peer (on replication failure).

func (*LeaderState) GetAllMatchIndexes

func (ls *LeaderState) GetAllMatchIndexes() map[string]uint64

GetAllMatchIndexes returns all match indexes.

func (*LeaderState) GetHealthyPeerCount

func (ls *LeaderState) GetHealthyPeerCount() int

GetHealthyPeerCount returns the number of healthy peers.

func (*LeaderState) GetLastHeartbeat

func (ls *LeaderState) GetLastHeartbeat(peerID string) time.Time

GetLastHeartbeat returns the last heartbeat time for a peer.

func (*LeaderState) GetMatchIndex

func (ls *LeaderState) GetMatchIndex(peerID string) uint64

GetMatchIndex returns the match index for a peer.

func (*LeaderState) GetNextIndex

func (ls *LeaderState) GetNextIndex(peerID string) uint64

GetNextIndex returns the next index for a peer.

func (*LeaderState) GetPeersNeedingHeartbeat

func (ls *LeaderState) GetPeersNeedingHeartbeat() []string

GetPeersNeedingHeartbeat returns peers that need heartbeats.

func (*LeaderState) GetReplicationStatus

func (ls *LeaderState) GetReplicationStatus() map[string]ReplicationStatus

GetReplicationStatus returns replication status for all peers.

func (*LeaderState) HasQuorum

func (ls *LeaderState) HasQuorum(totalNodes int) bool

HasQuorum checks if we have a healthy quorum.

func (*LeaderState) NeedsHeartbeat

func (ls *LeaderState) NeedsHeartbeat(peerID string) bool

NeedsHeartbeat checks if a peer needs a heartbeat.

func (*LeaderState) RecordHeartbeat

func (ls *LeaderState) RecordHeartbeat(peerID string)

RecordHeartbeat records a successful heartbeat to a peer.

func (*LeaderState) RemovePeer

func (ls *LeaderState) RemovePeer(peerID string)

RemovePeer removes a peer from tracking.

func (*LeaderState) SetMatchIndex

func (ls *LeaderState) SetMatchIndex(peerID string, index uint64)

SetMatchIndex sets the match index for a peer.

func (*LeaderState) SetNextIndex

func (ls *LeaderState) SetNextIndex(peerID string, index uint64)

SetNextIndex sets the next index for a peer.

func (*LeaderState) Start

func (ls *LeaderState) Start(ctx context.Context, lastLogIndex uint64, peers []string) error

Start starts the leader state.

func (*LeaderState) Stop

func (ls *LeaderState) Stop(ctx context.Context) error

Stop stops the leader state.

func (*LeaderState) UpdateMatchIndex

func (ls *LeaderState) UpdateMatchIndex(peerID string, matchIndex uint64)

UpdateMatchIndex updates match index and next index atomically.

type Log

type Log struct {
	// contains filtered or unexported fields
}

Log represents the replicated log.

func NewLog

func NewLog(logger forge.Logger, storage internal.Storage, cacheSize int) (*Log, error)

NewLog creates a new log.

func (*Log) Append

func (l *Log) Append(entry internal.LogEntry) error

Append appends a log entry.

func (*Log) AppendBatch

func (l *Log) AppendBatch(entries []internal.LogEntry) error

AppendBatch appends multiple log entries.

func (*Log) Compact

func (l *Log) Compact(index uint64, term uint64) error

Compact compacts the log up to the given index (inclusive).

func (*Log) Count

func (l *Log) Count() int

Count returns the number of log entries.

func (*Log) FirstIndex

func (l *Log) FirstIndex() uint64

FirstIndex returns the index of the first log entry.

func (*Log) Get

func (l *Log) Get(index uint64) (internal.LogEntry, error)

Get retrieves a log entry by index.

func (*Log) GetEntriesAfter

func (l *Log) GetEntriesAfter(index uint64, maxEntries int) ([]internal.LogEntry, error)

GetEntriesAfter returns all entries after the given index.

func (*Log) GetRange

func (l *Log) GetRange(start, end uint64) ([]internal.LogEntry, error)

GetRange retrieves a range of log entries.

func (*Log) LastIndex

func (l *Log) LastIndex() uint64

LastIndex returns the index of the last log entry.

func (*Log) LastTerm

func (l *Log) LastTerm() uint64

LastTerm returns the term of the last log entry.

func (*Log) MatchesTerm

func (l *Log) MatchesTerm(index, term uint64) bool

MatchesTerm checks if the log entry at index has the given term.

func (*Log) String

func (l *Log) String() string

String returns a string representation of the log.

func (*Log) TruncateAfter

func (l *Log) TruncateAfter(index uint64) error

TruncateAfter truncates the log after the given index.

type LogEntryBatch

type LogEntryBatch struct {
	Entries    []internal.LogEntry
	StartIndex uint64
	EndIndex   uint64
}

LogEntryBatch represents a batch of log entries.

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node implements the Raft consensus algorithm.

func NewNode

func NewNode(
	config Config,
	logger forge.Logger,
	stateMachine internal.StateMachine,
	transport internal.Transport,
	storage internal.Storage,
) (*Node, error)

NewNode creates a new Raft node.

func (*Node) AddNode

func (n *Node) AddNode(ctx context.Context, nodeID, address string, port int) error

AddNode adds a node to the cluster (must be called on leader).

func (*Node) AddPeer

func (n *Node) AddPeer(peerID string)

AddPeer adds a peer to the Raft node.

func (*Node) AppendEntries

AppendEntries handles an AppendEntries RPC from the leader.

func (*Node) Apply

func (n *Node) Apply(ctx context.Context, entry internal.LogEntry) error

Apply applies a log entry.

func (*Node) GetCommitIndex

func (n *Node) GetCommitIndex() uint64

GetCommitIndex returns the current commit index.

func (*Node) GetCurrentTerm

func (n *Node) GetCurrentTerm() uint64

GetCurrentTerm returns the current term (alias for GetTerm for RPC handler compatibility).

func (*Node) GetLeader

func (n *Node) GetLeader() string

GetLeader returns the current leader ID.

func (*Node) GetRole

func (n *Node) GetRole() internal.NodeRole

GetRole returns the current role.

func (*Node) GetStats

func (n *Node) GetStats() internal.RaftStats

GetStats returns Raft statistics.

func (*Node) GetTerm

func (n *Node) GetTerm() uint64

GetTerm returns the current term.

func (*Node) InstallSnapshot

InstallSnapshot handles an InstallSnapshot RPC.

func (*Node) IsLeader

func (n *Node) IsLeader() bool

IsLeader returns true if this node is the leader.

func (*Node) Propose

func (n *Node) Propose(ctx context.Context, command []byte) error

Propose proposes a new command to the cluster.

func (*Node) RemoveNode

func (n *Node) RemoveNode(ctx context.Context, nodeID string) error

RemoveNode removes a node from the cluster (must be called on leader).

func (*Node) RequestVote

RequestVote handles a RequestVote RPC.

func (*Node) Start

func (n *Node) Start(ctx context.Context) error

Start starts the Raft node.

func (*Node) StepDown

func (n *Node) StepDown(ctx context.Context) error

StepDown causes the leader to step down.

func (*Node) Stop

func (n *Node) Stop(ctx context.Context) error

Stop stops the Raft node.

func (*Node) TransferLeadership

func (n *Node) TransferLeadership(ctx context.Context, targetNodeID string) error

TransferLeadership transfers leadership to another node.

type PeerState

type PeerState struct {
	ID            string
	Address       string
	Port          int
	NextIndex     uint64
	MatchIndex    uint64
	LastContact   time.Time
	Replicating   bool
	ReplicationMu sync.Mutex
}

PeerState represents the state of a peer node.

type RPCHandler

type RPCHandler struct {
	// contains filtered or unexported fields
}

RPCHandler handles Raft RPC requests.

func NewRPCHandler

func NewRPCHandler(node *Node, logger forge.Logger) *RPCHandler

NewRPCHandler creates a new RPC handler.

func (*RPCHandler) BroadcastAppendEntries

func (rh *RPCHandler) BroadcastAppendEntries(ctx context.Context, peers []string, req internal.AppendEntriesRequest) map[string]error

BroadcastAppendEntries broadcasts AppendEntries to all peers.

func (*RPCHandler) BroadcastRequestVote

func (rh *RPCHandler) BroadcastRequestVote(ctx context.Context, peers []string, req internal.RequestVoteRequest) map[string]error

BroadcastRequestVote broadcasts RequestVote to all peers.

func (*RPCHandler) HandleAppendEntries

HandleAppendEntries handles AppendEntries RPC.

func (*RPCHandler) HandleInstallSnapshot

HandleInstallSnapshot handles InstallSnapshot RPC.

func (*RPCHandler) HandleRequestVote

HandleRequestVote handles RequestVote RPC.

func (*RPCHandler) SendAppendEntries

SendAppendEntries sends AppendEntries RPC to a peer.

func (*RPCHandler) SendInstallSnapshot

SendInstallSnapshot sends InstallSnapshot RPC to a peer.

func (*RPCHandler) SendRequestVote

SendRequestVote sends RequestVote RPC to a peer.

type ReplicationResult

type ReplicationResult struct {
	Success    bool
	MatchIndex uint64
	NodeID     string
	Term       uint64
	Error      error
}

ReplicationResult represents the result of log replication.

type ReplicationState

type ReplicationState struct {
	NextIndex     uint64
	MatchIndex    uint64
	LastContact   time.Time
	Inflight      int
	LastHeartbeat time.Time
}

ReplicationState represents the replication state for a peer.

type ReplicationStatus

type ReplicationStatus struct {
	PeerID        string
	NextIndex     uint64
	MatchIndex    uint64
	Lag           uint64
	LastHeartbeat time.Time
	Healthy       bool
}

ReplicationStatus represents replication status for a peer.

type SnapshotManager

type SnapshotManager struct {
	// contains filtered or unexported fields
}

SnapshotManager manages Raft snapshots.

func NewSnapshotManager

func NewSnapshotManager(
	config SnapshotManagerConfig,
	storage internal.Storage,
	stateMachine internal.StateMachine,
	logger forge.Logger,
) *SnapshotManager

NewSnapshotManager creates a new snapshot manager.

func (*SnapshotManager) CompactLog

func (sm *SnapshotManager) CompactLog(snapshotIndex uint64) error

CompactLog compacts the log up to the snapshot point.

func (*SnapshotManager) CreateSnapshot

func (sm *SnapshotManager) CreateSnapshot(ctx context.Context, lastIncludedIndex, lastIncludedTerm uint64) error

CreateSnapshot creates a new snapshot.

func (*SnapshotManager) GetLastSnapshotIndex

func (sm *SnapshotManager) GetLastSnapshotIndex() uint64

GetLastSnapshotIndex returns the last snapshot index.

func (*SnapshotManager) GetLastSnapshotTerm

func (sm *SnapshotManager) GetLastSnapshotTerm() uint64

GetLastSnapshotTerm returns the last snapshot term.

func (*SnapshotManager) GetLatestSnapshot

func (sm *SnapshotManager) GetLatestSnapshot() (*internal.SnapshotMetadata, []byte, error)

GetLatestSnapshot retrieves the latest snapshot.

func (*SnapshotManager) InstallSnapshot

func (sm *SnapshotManager) InstallSnapshot(req internal.InstallSnapshotRequest) error

InstallSnapshot installs a snapshot received from leader.

func (*SnapshotManager) ListSnapshots

func (sm *SnapshotManager) ListSnapshots() ([]internal.SnapshotMetadata, error)

ListSnapshots lists all available snapshots.

func (*SnapshotManager) RestoreSnapshot

func (sm *SnapshotManager) RestoreSnapshot(ctx context.Context, snapshotData []byte) error

RestoreSnapshot restores from a snapshot.

func (*SnapshotManager) ShouldCreateSnapshot

func (sm *SnapshotManager) ShouldCreateSnapshot(currentIndex uint64) bool

ShouldCreateSnapshot checks if a snapshot should be created.

func (*SnapshotManager) StreamSnapshot

func (sm *SnapshotManager) StreamSnapshot(writer io.Writer) error

StreamSnapshot streams a snapshot to a writer (for sending to peers).

type SnapshotManagerConfig

type SnapshotManagerConfig struct {
	NodeID            string
	SnapshotInterval  time.Duration
	SnapshotThreshold uint64
}

SnapshotManagerConfig contains snapshot manager configuration.

type SnapshotMeta

type SnapshotMeta struct {
	Index    uint64
	Term     uint64
	Size     int64
	Checksum string
	Created  time.Time
}

SnapshotMeta represents snapshot metadata.

type SnapshotMsg

type SnapshotMsg struct {
	Index    uint64
	Term     uint64
	ResultCh chan error
}

SnapshotMsg represents a snapshot message.

type State

type State int

State represents the Raft node state.

const (
	// StateFollower represents follower state.
	StateFollower State = iota
	// StateCandidate represents candidate state.
	StateCandidate
	// StateLeader represents leader state.
	StateLeader
)

func (State) String

func (s State) String() string

String returns the string representation of the state.

type VoteResponse

type VoteResponse struct {
	Term        uint64
	VoteGranted bool
	NodeID      string
}

VoteResponse represents a vote response from a peer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL