Documentation ¶
Index ¶
- type Opt
- func WithAdvertiseAddr(addr net.Addr) Opt
- func WithClusterSecret(secret string) Opt
- func WithCommitTimeout(timeout time.Duration) Opt
- func WithDebug(debug bool) Opt
- func WithElectionTimeout(timeout time.Duration) Opt
- func WithHeartbeatTimeout(timeout time.Duration) Opt
- func WithIsLeader(isLeader bool) Opt
- func WithLeaderLeaseTimeout(timeout time.Duration) Opt
- func WithMaxPool(max int) Opt
- func WithPeerID(peerID string) Opt
- func WithRaftDir(dir string) Opt
- func WithRestoreSnapshotOnRestart(restore bool) Opt
- func WithSnapshotRetention(retention int) Opt
- func WithTimeout(timeout time.Duration) Opt
- type Options
- type Raft
- func (s *Raft) Apply(bits []byte) (interface{}, error)
- func (r *Raft) Close() error
- func (s *Raft) Join(nodeID, addr string) error
- func (s *Raft) LeaderAddr() string
- func (r *Raft) PeerID() string
- func (s *Raft) Servers() ([]raft.Server, error)
- func (r *Raft) State() raft.RaftState
- func (s *Raft) Stats() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opt ¶
type Opt func(o *Options)
func WithAdvertiseAddr ¶
func WithClusterSecret ¶
func WithCommitTimeout ¶
func WithElectionTimeout ¶
func WithHeartbeatTimeout ¶
func WithIsLeader ¶
func WithLeaderLeaseTimeout ¶
func WithMaxPool ¶
func WithPeerID ¶
func WithRaftDir ¶
func WithSnapshotRetention ¶
func WithTimeout ¶
type Raft ¶
type Raft struct {
// contains filtered or unexported fields
}
func (*Raft) LeaderAddr ¶
Click to show internal directories.
Click to hide internal directories.